import AppSettings from "@runtime/base/AppSettings";
import { ClientMessage } from "@runtime/generate/message/ClientMessage";
import DeviceComponent from "@runtime/module/Device/DeviceComponent";
import ModalComponent, { ModalOptions } from "@runtime/module/Modal/ModalComponent";
import RouterComponent from "@runtime/module/Router/RouterComponent";
import TimerComponent from "@runtime/module/Timer/TimerComponent";
import WebSocketComponent from "@runtime/module/WebSocket/WebSocketComponent";
import WebWindowComponent from "@runtime/module/WebWindow/WebWindowComponent";
import AnimatorComponent from "@runtime/UnityEngineBridge/AnimatorComponent";
import AssetLoaderComponent from "@runtime/UnityEngineBridge/AssetLoaderComponent";
import GameObjectComponent from "@runtime/UnityEngineBridge/GameObjectComponent";
import HighlighterComponent from "@runtime/UnityEngineBridge/HighlighterComponent";
import InteractableObjectComponent from "@runtime/UnityEngineBridge/InteractableObjectComponent";
import LabelComponent from "@runtime/UnityEngineBridge/LabelComponent";
import PostProcessLayerComponent from "@runtime/UnityEngineBridge/PostProcessLayerComponent";
import TooltipComponent from "@runtime/UnityEngineBridge/TooltipComponent";
import { computed, ComputedRef, reactive, ref, Ref, UnwrapNestedRefs, watch, WatchStopHandle } from "vue";
import OrbitCameraComponent from "./OrbitCameraComponent";
import RoomComponent from "./RoomComponent";

function ToMap<TKey, TValue>(sources: Array<TValue>, keySelector: (element: TValue) => TKey): Map<TKey, TValue> {
    const map = new Map<TKey, TValue>();
    for (const element of sources) {
        map.set(keySelector(element), element);
    }
    return map;
}

export const ModuleConfigs: ComputedRef<Array<{ Id: number, Name: string, Description: string, Icon: string }>> = computed(() => {
    const configs = [
        { Id: 1, Name: 'Introduction', Description: '系统简介', Icon: 'ic_menu_1' },
        { Id: 2, Name: 'Structure', Description: '结构认知', Icon: 'ic_menu_2' },
        { Id: 3, Name: 'Principle', Description: '工作原理', Icon: 'ic_menu_3' },
        { Id: 4, Name: 'Install', Description: '安装', Icon: 'ic_menu_4' },
        { Id: 5, Name: 'Calibration', Description: '标定', Icon: 'ic_menu_5' },
        { Id: 6, Name: 'Protocol', Description: '协议解读', Icon: 'ic_menu_6' },
    ];

    if (InertialNavigationComponent.Default.Status.value == '设备连接成功') {
        configs.add({ Id: 7, Name: 'Usage', Description: '应用', Icon: 'ic_menu_7' },);
    }

    return configs;
});

class CoroutineLock implements Chaos.IDisposable {
    public Type: number = 0;
    public Key: number = 0;
    public Count: number = 0;

    private isCompleted: boolean = false;
    private task?: (value: void | PromiseLike<void>) => void;

    constructor(type: number, key: number, count: number) {
        this.Type = type;
        this.Key = key;
        this.Count = count;
    }

    async WaitAsync(): Promise<void> {
        if (this.isCompleted) {
            return;
        }

        return new Promise(resolve => this.task = resolve);
    }

    Dispose() {
        InertialNavigationComponent.Default.IsLoading.value = false;

        this.Type = 0;
        this.Key = 0;
        this.Count = 0;

        if (this.task != undefined) {
            this.task();
        }

        this.isCompleted = true;
    }
}

/**
 * 组合惯导组件
 */
export default class InertialNavigationComponent {
    private static instance: InertialNavigationComponent = new InertialNavigationComponent();
    /**
     * 组合惯导组件
     */
    public static get Default(): InertialNavigationComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        // this.watchStopHandles.push(watch(this.Status, this.OnDeviceUpdatedAsync.bind(this)));
        this.watchStopHandles.push(watch(this.Module, this.OnModuleChangedAsync.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public DeviceId: number = 1;

    public Status: ComputedRef<string> = computed(() => DeviceComponent.Default.Devices.get(this.DeviceId)?.Status ?? '');

    public IsLoading: Ref<boolean> = ref(false);

    public Module: Ref<string> = ref('');

    public Loaded: Ref<boolean> = ref(false);

    private map: Map<number, Array<CoroutineLock>> = new Map();

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
        ModalComponent.Default.AddDynamicModules(import.meta.glob('/src/components/Apps/InertialNavigation/Exit.vue'));
        ModalComponent.Default.AddDynamicModules(import.meta.glob('/src/components/Apps/InertialNavigation/MessageBox.vue'));

        this.Module.value = 'MenuIndex';

        // 启动Unity
        const configuration = JSON.stringify({
            LocalAddress: AppSettings.Default.LocalAddress,
            ShortName: 'P10051',
            Type: 5,
        });
        await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.EmbeddedApplicationLaunchRequest('../EmbeddedApplication/Unity/Mix.Unity.exe', configuration));

        // 获取Unity版本状态
        await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.EmbeddedApplicationVersionRequest());

        this.Loaded.value = true;
        this.Module.value = 'Introduction';
    }

    public async Destroy(): Promise<void> {
        this.Loaded.value = false;
    }

    // private async OnDeviceUpdatedAsync(current: string, previous: string): Promise<void> {
    //     const lock = await InertialNavigationComponent.Default.WaitAsync();

    //     const modules = ModuleConfigs.value.map(config => config.Name);
    //     if (this.Status.value != '设备连接成功' && !modules.includes(this.Module.value)) {
    //         this.Module.value = modules[0];
    //     }

    //     lock.Dispose();
    // }

    /**
    * 模块发生变化时
    * @param value 模块
    */
    private async OnModuleChangedAsync(value: string): Promise<void> {
        console.log(value, '1111+++++++++++++++++++++++++++++++++++++++++++++++++++++++');

        // 切换至指定传感器路由
        const url = `/${AppSettings.Default.Type}/${value}`;
        await RouterComponent.Default.NavigateToAsync(url);
    }

    public async OnExitAsync(): Promise<void> {
        const volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
        const effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(volume);

        const options = ModalOptions.Default()
            .WithPrefix('/src/components/Apps/InertialNavigation/')
            .WithType('Exit')
            .WithContent('是否确认退出软件?')
            .WithButtons(['确定', '取消']);
        const result = await ModalComponent.Default.PopupAsync(options);

        if (result == '确定') {
            WebSocketComponent.Default.PostMessage(new ClientMessage.ShutdownMessage());
        }

        await PostProcessLayerComponent.Default.RemoveEffectAsync(volume, effect);
        await PostProcessLayerComponent.Default.RemoveVolumeAsync(volume);
    }

    public async WaitAsync(type: number = 0, key: number = 0): Promise<CoroutineLock> {
        this.IsLoading.value = true;

        if (!this.map.has(key)) {
            this.map.set(key, []);
        }

        const locks = this.map.get(key)!;
        const lock = new CoroutineLock(type, key, locks.length);
        locks.add(lock);
        if (locks.length < 2) {
            return new Promise(resolve => resolve(lock));
        } else {
            const previous = locks[locks.length - 2];
            await previous.WaitAsync();
            return new Promise(resolve => resolve(lock));
        }
    }
}

/**
 * 简介
 */
export class IntroductionComponent {
    private static instance: IntroductionComponent = new IntroductionComponent();
    /**
     * 简介
     */
    public static get Default(): IntroductionComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public Title: string = '组合惯导系统';

    public Description: string = `组合惯导系统，即系统包含卫星定位系统（GPS(全球定位系统)/北斗卫星导航系统/GNSS（全球导航卫星系统））和惯性定向定位导航系统（INS）的定向定位导航系统。根据INS和卫星的导航功能互补的特点，以适当的方法将两者组合来提高系统的整体导航精度及导航性能以及空中对准和再对准的能力。`;


    private instanceId: number = 0;

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
        while (!InertialNavigationComponent.Default.Loaded.value) {
            await TimerComponent.Default.WaitAsync(10);
        }

        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetTransparentBackground();
        TooltipComponent.Default.Clear();

        if (this.instanceId == 0) {
            this.instanceId = await AssetLoaderComponent.Default.LoadAsync('Assets/R00034/ICV/Product/Introduction/组合惯导系统/组合惯导系统.prefab');
        } else {
            await GameObjectComponent.Default.ShowAsync(this.instanceId);
        }
        await OrbitCameraComponent.Default.UpdateAsync([0, 0.18, -0.18], 90, 20, 3, 0.1, 10);

        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        await GameObjectComponent.Default.HideAsync(this.instanceId);

        lock.Dispose();
    }
}

class StructureOptionConfig {
    Id: number;
    InstanceId: number;
    Type: string;
    Asset: string;
    /**
     * 动画状态
     */
    State: string;
    Description: string;
    ViewId: number;

    constructor(id: number, instanceId: number, type: string, asset: string, state: string, description: string, viewId: number) {
        this.Id = id;
        this.InstanceId = instanceId;
        this.Type = type;
        this.Asset = asset;
        this.State = state;
        this.Description = description;
        this.ViewId = viewId;
    }
}

class StructureConfig {
    Id: number;
    Name: string;
    Options: Array<number>;

    constructor(id: number, name: string, options: Array<number>) {
        this.Id = id;
        this.Name = name;
        this.Options = options;
    }
}

class TreeNode {
    public Id: number;
    public Parent: TreeNode | undefined;
    public Children: Array<TreeNode>;

    public Indent: number;
    public Expand: boolean;

    public get HasChildren(): boolean {
        return this.Children.length != 0;
    }


    constructor(id: number, children: Array<TreeNode> = [], expand: boolean = false, parent: TreeNode | undefined = undefined) {
        this.Id = id;
        this.Parent = parent;
        this.Children = children;
        this.Indent = 0;
        this.Expand = expand;

        for (const child of this.Children) {
            child.Parent = this;
            child.Indent = this.Indent + 1;
        }
    }
}

/**
 * 结构认知
 */
export class StructureComponent {
    private static instance: StructureComponent = new StructureComponent();
    /**
     * 结构认知
     */
    public static get Default(): StructureComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        this.watchStopHandles.push(watch(this.Id, this.OnIdChangedAsync.bind(this)));
        this.watchStopHandles.push(watch(this.OptionId, this.OnOptionIdChangedAsync.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public Node: UnwrapNestedRefs<TreeNode> = reactive(new TreeNode(1, [
        new TreeNode(2),
        new TreeNode(3),
        new TreeNode(4),
        new TreeNode(5),
        new TreeNode(6),
        new TreeNode(7),
        new TreeNode(8),
        new TreeNode(9),
        new TreeNode(10),
        new TreeNode(11),
    ], true));

    /**
     * 结构配置
     */
    public Configs: UnwrapNestedRefs<Map<number, StructureConfig>> = reactive(ToMap<number, StructureConfig>([
        new StructureConfig(1, '组合导航系统', [1, 2, 3]),
        new StructureConfig(2, '惯导模块系统', [4, 5, 6]),
        new StructureConfig(3, '卫星主天线', [7, 8, 9]),
        new StructureConfig(4, '卫星副天线', [10, 11, 12]),
        new StructureConfig(5, '计算平台', [13, 14]),
        new StructureConfig(6, '惯导模块系统线束', [15, 16]),
        new StructureConfig(7, '卫星主天线线束', [17, 18]),
        new StructureConfig(8, '卫星副天线线束', [19, 20]),
        new StructureConfig(9, '组合导航系统数据通讯线', [21, 22]),
        new StructureConfig(10, '组合惯导电源', [23]),
        new StructureConfig(11, '计算机平台电源', [24]),
    ], element => element.Id));

    public Options: UnwrapNestedRefs<Map<number, StructureOptionConfig>> = reactive(ToMap<number, StructureOptionConfig>([
        new StructureOptionConfig(1, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/组合导航系统.prefab', '', '', 1001),
        new StructureOptionConfig(2, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/组合导航系统.prefab', '', '', 1002),
        new StructureOptionConfig(3, 0, '功用', 'Assets/R00034/ICV/Product/FunctionPrinciple/组合惯导系统/组合惯导系统功用.prefab', '', '组合惯导系统的作用是实现载体精准定位。GPS卫星定位弥补了惯导的累计误差，惯导弥补了GPS卫星定位的不稳定性和易受干扰性。二者结合，实现载体的精准定位。', 1003),

        new StructureOptionConfig(4, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/惯导模块系统.prefab', '', '', 1004),
        new StructureOptionConfig(5, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/惯导模块系统.prefab', '', '', 1005),
        new StructureOptionConfig(6, 0, '功用', 'Assets/R00034/ICV/Product/FunctionPrinciple/组合惯导系统/惯性导航模块功用.prefab', '', '惯性导航模块主要的作用是实时测量载体的各个方向的加速度、角速度，并通过算法来优化降低测量数据的误差。最终将处理好的信息传递至车载计算平台，进行数据融合处理。', 1006),

        new StructureOptionConfig(7, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星主天线.prefab', '', '', 1007),
        new StructureOptionConfig(8, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星主天线.prefab', '', '', 1008),
        new StructureOptionConfig(9, 0, '功用', 'Assets/R00034/ICV/Product/FunctionPrinciple/组合惯导系统/卫星天线功用.prefab', '', '卫星天线主要的作用是接收卫星信号，可以同时接收多个卫星信号。', 1009),

        new StructureOptionConfig(10, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星副天线.prefab', '', '', 1010),
        new StructureOptionConfig(11, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星副天线.prefab', '', '', 1011),
        new StructureOptionConfig(12, 0, '功用', 'Assets/R00034/ICV/Product/FunctionPrinciple/组合惯导系统/卫星天线功用.prefab', '', '', 1012),

        new StructureOptionConfig(13, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/计算平台.prefab', '', '', 1013),
        new StructureOptionConfig(14, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/计算平台.prefab', '', '', 1014),

        new StructureOptionConfig(15, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/惯导模块系统线束.prefab', '', '', 1015),
        new StructureOptionConfig(16, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/惯导模块系统线束.prefab', '', '', 1016),

        new StructureOptionConfig(17, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星主天线线束.prefab', '', '', 1017),
        new StructureOptionConfig(18, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星主天线线束.prefab', '', '', 1018),

        new StructureOptionConfig(19, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星副天线线束.prefab', '', '', 1019),
        new StructureOptionConfig(20, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/卫星副天线线束.prefab', '', '', 1020),

        new StructureOptionConfig(21, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/组合导航系统数据通讯线.prefab', '', '', 1021),
        new StructureOptionConfig(22, 0, '组成', 'Assets/R00034/ICV/Product/Structure/组合导航系统/组合导航系统数据通讯线.prefab', '', '', 1022),

        new StructureOptionConfig(23, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/组合惯导电源.prefab', '', '', 1023),

        new StructureOptionConfig(24, 0, '结构', 'Assets/R00034/ICV/Product/Structure/组合导航系统/计算机平台电源.prefab', '', '', 1024),
    ], element => element.Id));

    /**
     * 当前结构配置Id
     */
    public Id: Ref<number> = ref(1);

    /**
     * 当前结构配置选项Id
     */
    public OptionId: Ref<number> = ref(1);

    /**
     * 当前结构配置
     */
    public Config: ComputedRef<StructureConfig> = computed(() => this.Configs.get(this.Id.value)!);

    /**
     * 当前结构配置
     */
    public Option: ComputedRef<StructureOptionConfig> = computed(() => this.Options.get(this.OptionId.value)!);

    public FilterOptions: ComputedRef<Array<StructureOptionConfig>> = computed(() => Array.from(this.Options.values()).filter(config => this.Config.value.Options.includes(config.Id)));

    /**
     * 当前选项对应文本描述
     */
    public Description: ComputedRef<string> = computed(() => this.Options.get(this.OptionId.value)?.Description ?? '');
    public DescriptionAudioAccessibility: Ref<boolean> = ref(true);
    public AudioStats = reactive({ pausable: false });

    private hasInitialized: boolean = false;
    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetTransparentBackground();
        TooltipComponent.Default.Clear();

        if (!this.hasInitialized) {
            await this.LoadAsync();
            this.hasInitialized = true;
        }

        await GameObjectComponent.Default.ShowAsync(this.Option.value.InstanceId);
        await OrbitCameraComponent.Default.ApplyConfigAsync(this.Option.value.ViewId);
        if (this.Option.value.Type == '组成') {
            // 加载标签
            await LabelComponent.Default.LoadAsync(this.Option.value.InstanceId);
        }

        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        LabelComponent.Default.Clear();
        await HighlighterComponent.Default.ClearAsync();

        await GameObjectComponent.Default.HideAsync(this.Option.value.InstanceId);

        lock.Dispose()
    }

    private FindNode(id: number): TreeNode | undefined {
        let node: TreeNode | undefined;

        function Find(id: number, input: TreeNode): void {
            if (input.Id == id) {
                node = input;
                return;
            }

            for (const child of input.Children) {
                Find(id, child);
            }
        }

        Find(id, this.Node);

        return node;
    }

    /**
     * 判断当年前节点是否有子节点
     * @param id 当前节点Id
     * @returns 是否有子节点
     */
    public HasChildren(id: number): boolean {
        return this.FindNode(id)?.HasChildren ?? false;
    }

    /**
     * 计算当前节点缩进级别
     * @param id 当前节点Id
     * @returns 当前节点缩进级别
     */
    public CalculateIndent(id: number): number {
        return this.FindNode(id)?.Indent ?? 0;
    }

    public CanShowNode(id: number): boolean {
        let node = this.FindNode(id)!;
        while (node.Parent != undefined) {
            if (!node.Parent.Expand) {
                return false;
            } else {
                node = node.Parent;
            }
        }
        return true;
    }

    public IsNodeExpand(id: number): boolean {
        return this.FindNode(id)?.Expand ?? false;
    }

    public SwitchNodeExpand(id: number): void {
        let node = this.FindNode(id)!;
        node.Expand = !node.Expand;
    }

    private async LoadAsync(): Promise<void> {
        this.Option.value.InstanceId = await AssetLoaderComponent.Default.LoadAsync(this.Option.value.Asset);
    }

    /**
     * Id发生变化时
     */
    private async OnIdChangedAsync(): Promise<void> {
        this.OptionId.value = this.Config.value.Options[0];
    }

    /**
     * 选项发生变化时
     * @param current 当前值
     * @param previous 过去值
     */
    private async OnOptionIdChangedAsync(current: number, previous: number): Promise<void> {
        InertialNavigationComponent.Default.IsLoading.value = true;

        if (import.meta.env.PROD) {
            await GameObjectComponent.Default.HideAsync(this.Options.get(previous)!.InstanceId);

            // 清空标签
            LabelComponent.Default.Clear();
            // 重置高亮
            await HighlighterComponent.Default.ClearAsync();

            if (this.Option.value.InstanceId == 0) {
                const volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
                const effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(volume);

                // 加载模型
                this.Option.value.InstanceId = await AssetLoaderComponent.Default.LoadAsync(this.Option.value.Asset);

                await PostProcessLayerComponent.Default.RemoveEffectAsync(volume, effect);
                await PostProcessLayerComponent.Default.RemoveVolumeAsync(volume);
            }

            // 显示当前选项模型
            await GameObjectComponent.Default.ShowAsync(this.Option.value.InstanceId);

            // 切换视角
            await OrbitCameraComponent.Default.ApplyConfigAsync(this.Option.value.ViewId);

            if (this.Option.value.State != '') {
                // 播放动画
                await AnimatorComponent.Default.PlayAsync(this.Option.value.InstanceId, this.Option.value.State, 1000);
            }

            if (this.Option.value.Type == '组成') {
                // 加载标签
                await LabelComponent.Default.LoadAsync(this.Option.value.InstanceId);
            }
        }

        InertialNavigationComponent.Default.IsLoading.value = false;
    }
}

class PrincipleConfig {
    Id: number;
    InstanceId: number;
    Name: string;
    Asset: string;
    /**
     * 动画状态
     */
    State: string;
    Description: string;
    ViewId: number;

    constructor(id: number, instanceId: number, name: string, asset: string, state: string, description: string, viewId: number) {
        this.Id = id;
        this.InstanceId = instanceId;
        this.Name = name;
        this.Asset = asset;
        this.State = state;
        this.Description = description;
        this.ViewId = viewId;
    }
}

/**
 * 工作原理
 */
export class PrincipleComponent {
    private static instance: PrincipleComponent = new PrincipleComponent();
    /**
     * 工作原理
     */
    public static get Default(): PrincipleComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        this.watchStopHandles.push(watch(this.Id, this.OnIdChangedAsync.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    /**
    * 当前原理配置
    */
    public Configs: UnwrapNestedRefs<Array<PrincipleConfig>> = reactive([
        new PrincipleConfig(
            1,
            0,
            '组合惯导系统工作原理',
            'Assets/R00034/ICV/Product/Principle/组合惯导系统/组合惯导系统工作原理.prefab',
            '',
            '组合惯导的通过GPS获得载体定位信息，惯导通过定位信息及测量的运动信息进行位置的累计增加，实时预测载体的位置，直道下一次再获得GPS定位信息后，进行误差校正。当车辆驶入隧道、卫星信号弱的区域时，一段时间内无法收到GPS信号，此时只能依靠惯导进行导航，但惯导有误差，随着时间的增加，累计误差会越来越大，而无法做到精确定位。当车辆驶出隧道、卫星信号弱的区域时，GPS重新获得定位信息后，对惯导进行误差校正。GPS弥补惯导的累计误差缺陷，惯导弥补GPS的易受干扰的缺陷，二者组合起来实现精准定位。',
            1026),
    ]);

    /**
     * 当前原理配置Id
     */
    public Id: Ref<number> = ref(0);

    public Description: Ref<string> = ref('');
    public DescriptionAudioAccessibility: Ref<boolean> = ref(true);
    public AudioStats = reactive({ pausable: false });

    private watchStopHandles: Array<WatchStopHandle> = [];

    private instanceIds: Array<number> = [];

    public async Awake(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetTransparentBackground();
        TooltipComponent.Default.Clear();

        if (this.instanceIds.length == 0) {
            await this.LoadAsync(this.Configs.map(config => config.Asset));
            this.Id.value = this.Configs[0].Id;
        }

        const config = this.Configs.find(config => config.Id == this.Id.value)!;
        await GameObjectComponent.Default.ShowAsync(config.InstanceId);
        await OrbitCameraComponent.Default.ApplyConfigAsync(config.ViewId);

        //lock.Dispose();
        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();
        await GameObjectComponent.Default.HideAsync(this.instanceIds);
        //lock.Dispose();
        lock.Dispose();
    }

    private async LoadAsync(assets: Array<string>): Promise<void> {
        if (import.meta.env.DEV) {
            return;
        }

        const volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
        const effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(volume);

        this.instanceIds.clear();
        this.instanceIds.addRange(await AssetLoaderComponent.Default.LoadAllAsync(assets));

        await PostProcessLayerComponent.Default.RemoveEffectAsync(volume, effect);
        await PostProcessLayerComponent.Default.RemoveVolumeAsync(volume);

        for (let index = 0; index < this.instanceIds.length; ++index) {
            const instanceId = this.instanceIds[index];
            this.Configs[index].InstanceId = instanceId;
        }

        await GameObjectComponent.Default.HideAsync(this.instanceIds);
    }

    /**
     * 原理Id发生变化时
     * @param value 值
     */
    private async OnIdChangedAsync(value: number, previous: number): Promise<void> {
        // 更新结构数据
        const config = this.Configs.find(config => config.Id == value);
        const previousConfig = this.Configs.find(config => config.Id == previous);
        if (import.meta.env.PROD) {
            if (config != null) {
                if (previousConfig != null) {
                    await GameObjectComponent.Default.HideAsync(previousConfig.InstanceId);
                }

                await GameObjectComponent.Default.ShowAsync(config.InstanceId);
            } else {
                window.Logger.Error(`对应选项(Id:${value})不存在`);
            }
        }

        this.Description.value = config?.Description ?? '';
    }
}

class InstallStepConfig {
    Id: number;
    Name: string;
    Asset: string;

    constructor(id: number, name: string, asset: string) {
        this.Id = id;
        this.Name = name;
        this.Asset = asset;
    }
}

class InstallViewConfig {
    Id: number;
    Name: string;
    Icon: string;

    constructor(id: number, name: string, icon: string) {
        this.Id = id;
        this.Name = name;
        this.Icon = icon;
    }
}

/**
 * 安装组件
 */
export class InstallComponent {
    private static instance: InstallComponent = new InstallComponent();
    /**
     * 安装组件
     */
    public static get Default(): InstallComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        this.watchStopHandles.push(watch(this.ViewId, this.OnViewChangedAsync.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public StepDescriptions: Array<string> = [
        '1. 安装惯导模块系统',
        '2. 安装惯导模块系统固定螺栓',
        '3. 安装卫星主天线',
        '4. 安装卫星副天线',
        '5. 安装计算平台',
        '6. 安装卫星主天线线束',
        '7. 安装卫星副天线线束',
        '8. 安装惯导模型系统线束',
        '9. 安装组合导航系统数据通讯线',
        '10. 安装组合惯导系统电源',
        '11. 安装计算平台电源',
    ];

    /**
     * 步骤提示
     */
    public StepTips: Array<InstallStepConfig> = [
        new InstallStepConfig(1, '步骤一', '安装步骤说明001.png'),
        new InstallStepConfig(2, '步骤二', '安装步骤说明002.png'),
        new InstallStepConfig(3, '步骤三', '安装步骤说明003.png'),
        new InstallStepConfig(4, '步骤四', '安装步骤说明004.png'),
        new InstallStepConfig(4, '步骤五', '安装步骤说明005.png'),
        new InstallStepConfig(4, '步骤六', '安装步骤说明006.png'),
    ];

    /**
     * 视角配置
     */
    public Views: Array<InstallViewConfig> = [
        new InstallViewConfig(1028, '目标', 'ic_mubiao'),
        new InstallViewConfig(1029, '零件桌', 'ic_lingjianzhuo'),
        new InstallViewConfig(1030, '车顶', 'ic_cheding'),
        new InstallViewConfig(1031, '车前', 'ic_cheqian'),
    ];

    public CanRecyclePart: ComputedRef<boolean> = computed(() => this.ViewId.value == 1029);

    public ViewId: Ref<number> = ref(0);

    public StepState: Ref<boolean> = ref(false);

    private watchStopHandles: Array<WatchStopHandle> = [];

    private instanceIds: Array<number> = [];

    public async Awake(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetTransparentBackground();
        TooltipComponent.Default.Clear();

        await RoomComponent.Default.ShowAsync();

        if (import.meta.env.PROD) {
            if (this.instanceIds.length == 0) {
                await this.LoadAsync([
                    'Assets/R00034/ICV/Product/DisassemblyAndAssembly/毫米波雷达系统/零件桌.prefab',
                    'Assets/R00034/ICV/Product/DisassemblyAndAssembly/组合惯导系统安装/组合惯导系统安装.prefab'
                ]);
            } else {
                await GameObjectComponent.Default.ShowAsync(this.instanceIds);
            }
        }

        this.ViewId.value = this.Views[0].Id;
        await OrbitCameraComponent.Default.ApplyConfigAsync(this.ViewId.value);

        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        this.StepState.value = false;

        await GameObjectComponent.Default.HideAsync(this.instanceIds);
        await RoomComponent.Default.HideAsync();

        lock.Dispose();
    }

    private async LoadAsync(assets: Array<string>): Promise<void> {
        const volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
        const effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(volume);

        this.instanceIds.clear();
        this.instanceIds.addRange(await AssetLoaderComponent.Default.LoadAllAsync(assets));

        await PostProcessLayerComponent.Default.RemoveEffectAsync(volume, effect);
        await PostProcessLayerComponent.Default.RemoveVolumeAsync(volume);

        await InteractableObjectComponent.Default.LoadAsync(['InertialNavigation', 'InertialNavigationLocation']);
    }

    /**
     * 安装视角发生变化
     * @param viewId 值
     */
    private async OnViewChangedAsync(viewId: number): Promise<void> {
        if (import.meta.env.PROD) {
            OrbitCameraComponent.Default.ApplyConfigAsync(viewId);
        } else {
            window.Logger.Debug(`视角切换: ${viewId}`);
        }
    }

    public async RecycleAsync(id: number, instanceId: number): Promise<void> {
        InteractableObjectComponent.Default.Remove(id);
        await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.UncheckInteractableObjectRequest(id, instanceId));
    }
}

class CalibrationConfig {
    Id: number;
    Name: string;
    Asset: string;
    Options: Array<string>;
    ViewId: number;

    Descriptions: Map<string, string>;
    Records: Map<string, number>;

    /**
     * 物体实例Id
     */
    InstanceId: number;
    /**
     * 原点实例Id
     */
    Origin: number;
    /**
     * 是否显示原点
     */
    ShowOrigin: boolean;
    /**
     * 标定值
     */
    Values: Array<number>;

    constructor(id: number, name: string, asset: string, options: Array<string>, viewId: number, descriptions: Map<string, string>, records: Map<string, number>, instanceId: number = 0, origin: number = 0, showOrigin: boolean = false, values: Array<number> = []) {
        this.Id = id;
        this.Name = name;
        this.Asset = asset;
        this.Options = options;
        this.ViewId = viewId;

        this.Descriptions = descriptions;
        this.Records = records;

        this.InstanceId = instanceId;
        this.Origin = origin;
        this.ShowOrigin = showOrigin;
        this.Values = values;
    }
}

/**
 * 标定组件
 */
export class CalibrationComponent {
    private static instance: CalibrationComponent = new CalibrationComponent();
    /**
     * 标定组件
     */
    public static get Default(): CalibrationComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        this.watchStopHandles.push(watch(this.Id, this.OnIdChangedAsync.bind(this)));
        this.watchStopHandles.push(watch(this.ShowOrigin, this.OnOriginStateChangedAsync.bind(this)));
        this.watchStopHandles.push(watch(this.ShowTips, this.OnPopupChangedAsync.bind(this)));
        this.watchStopHandles.push(watch(this.ShowForms, this.OnPopupChangedAsync.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public Configs: UnwrapNestedRefs<Map<number, CalibrationConfig>> = reactive(ToMap<number, CalibrationConfig>([
        new CalibrationConfig(1, '车辆坐标系标定',
            'Assets/R00034/ICV/Product/Calibration/组合惯导系统标定/组合惯导系统车辆坐标系标定.prefab',
            ['显示原点', '标定说明', '参数标定'],
            1033,
            new Map<string, string>([
                ["Car_W", "车辆左侧至右侧距离:"],
                ["Car_L", "车辆前侧至后侧距离:"],
                ["Radar_X", "惯导中心至车辆左侧距离:"],
                ["Radar_Y", "惯导中心至车辆前侧距离:"],
                ["Radar_Z", "惯导中心至地面高度:"],
                ["Source_X", "车辆轮轴中心至车辆左侧距离:"],
                ["Source_Y", "车辆轮轴中心至车辆前(后)侧距离:"],
                ["Source_Z", "车辆轮轴中心至地面距离:"],
            ]),
            new Map<string, number>([
                ["Car_W", 0],
                ["Car_L", 0],
                ["Radar_X", 0],
                ["Radar_Y", 0],
                ["Radar_Z", 0],
                ["Source_X", 0],
                ["Source_Y", 0],
                ["Source_Z", 0],
            ]),
        ),
        new CalibrationConfig(2, '杆臂标定',
            'Assets/R00034/ICV/Product/Calibration/组合惯导系统标定/组合惯导系统杆臂标定.prefab',
            ['显示原点', '标定说明', '参数标定'],
            1034,
            new Map<string, string>([
                ["Car_W", "车辆左侧至右侧距离:"],
                ["Car_L", "车辆前侧至后侧距离:"],
                ["Target_X", "惯导中心至车辆左侧距离:"],
                ["Target_Y", "惯导中心至车辆前侧距离:"],
                ["Target_Z", "惯导中心至地面高度:"],
                ["Antenna_X", "主天线底部中心至车辆左侧距离:"],
                ["Antenna_Y", "主天线底部中心至车辆前侧距离:"],
                ["Antenna_Z", "主天线底部中心至地面高度:"],
                ["Source_X", "车辆轮轴中心至车辆左侧距离:"],
                ["Source_Y", "车辆轮轴中心至车辆前(后)侧距离:"],
                ["Source_Z", "车辆轮轴中心至地面距离:"],
            ]),
            new Map<string, number>([
                ["Car_W", 0],
                ["Car_L", 0],
                ["Target_X", 0],
                ["Target_Y", 0],
                ["Target_Z", 0],
                ["Antenna_X", 0],
                ["Antenna_Y", 0],
                ["Antenna_Z", 0],
                ["Source_X", 0],
                ["Source_Y", 0],
                ["Source_Z", 0],
            ]),
        ),
        new CalibrationConfig(3, '航向偏置标定',
            'Assets/R00034/ICV/Product/Calibration/组合惯导系统标定/组合惯导系统航向偏置标定.prefab',
            ['标定说明', '参数标定'],
            1035,
            new Map<string, string>([
                ['LeftLength', '主天线底部中心至惯导中心距离：'],
                ['RightLength', '副天线底部中心至惯导中心距离：'],
                ['LeftAngle', '主天线底部中心至惯导中心角度：'],
                ['RightAngle', '副天线底部中心至惯导中心角度：'],
            ]),
            new Map<string, number>(),
        ),
    ], element => element.Id));

    public Tips = [
        '标定说明001.png',
        '标定说明002.png',
        '标定说明003.png',
        '标定说明004.png',
    ];

    /**
     * 当前标定配置Id
     */
    public Id: Ref<number> = ref(1);

    public Config: ComputedRef<CalibrationConfig> = computed(() => this.Configs.get(this.Id.value)!);

    public Options: ComputedRef<Array<string>> = computed(() => this.Config.value.Options);

    /**
     * 显示标定说明
     */
    public ShowOrigin: Ref<boolean> = ref(false);

    /**
     * 显示标定说明
     */
    public ShowTips: Ref<boolean> = ref(false);

    /**
     * 显示参数标定
     */
    public ShowForms: Ref<boolean> = ref(false);

    public GizmosPointX = ref(0);
    public GizmosPointY = ref(0);
    public GizmosPointZ = ref(0);

    public LeverArmPointX = ref(0);
    public LeverArmPointY = ref(0);
    public LeverArmPointZ = ref(0);
    public LeverArmAntennaX = ref(0);
    public LeverArmAntennaY = ref(0);
    public LeverArmAntennaZ = ref(0);

    public AzimuthMainAntenna = ref(0);
    public AzimuthSubAntenna = ref(0);
    public AzimuthAngle = ref(0);

    private hasInitialized: boolean = false;

    private volume: number = 0;
    private effect: number = 0;

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetTransparentBackground();
        TooltipComponent.Default.Clear();

        await RoomComponent.Default.ShowAsync();

        if (!this.hasInitialized) {
            await this.LoadAsync();
            this.hasInitialized = true;
        }

        await GameObjectComponent.Default.ShowAsync(this.Config.value.InstanceId);
        await OrbitCameraComponent.Default.ApplyConfigAsync(this.Config.value.ViewId);

        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        await GameObjectComponent.Default.HideAsync(this.Config.value.InstanceId);

        await RoomComponent.Default.HideAsync();

        lock.Dispose();
    }

    public GetRecord(key: string): number {
        return this.Config.value.Records.get(key) ?? 0;
    }

    private async OnPopupChangedAsync(value: boolean): Promise<void> {
        if (value) {
            this.volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
            this.effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(this.volume);
        } else {
            await PostProcessLayerComponent.Default.RemoveEffectAsync(this.volume, this.effect);
            await PostProcessLayerComponent.Default.RemoveVolumeAsync(this.volume);
        }
    }

    private async LoadAsync(): Promise<void> {
        if (import.meta.env.DEV) {
            return;
        }

        const volume = await PostProcessLayerComponent.Default.AddVolumeAsync();
        const effect = await PostProcessLayerComponent.Default.AddKawaseBlurAsync(volume);

        // 加载模型
        const assets = Array.from(this.Configs.values()).map(config => config.Asset);
        const instanceIds = await AssetLoaderComponent.Default.LoadAllAsync(assets);

        const keys = Array.from(this.Configs.keys());
        for (let i = 0; i < instanceIds.length; ++i) {
            this.Configs.get(keys[i])!.InstanceId = instanceIds[i];
        }

        // 初始化车辆坐标系标定
        const gizmos: ClientMessage.InertialNavigationGizmosResponse = await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.InertialNavigationGizmosRequest(this.Configs.get(keys[0])!.InstanceId));
        this.Configs.get(keys[0])!.Origin = gizmos.Origin;
        this.Configs.get(keys[0])!.Values.clear();
        this.Configs.get(keys[0])!.Values.addRange(gizmos.Values.map(value => Math.round(value * Math.pow(10, 2)) / Math.pow(10, 2)));

        // 初始化杆臂标定
        const leverArm: ClientMessage.InertialNavigationLeverArmResponse = await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.InertialNavigationLeverArmRequest(this.Configs.get(keys[1])!.InstanceId));
        this.Configs.get(keys[1])!.Origin = leverArm.Origin;
        this.Configs.get(keys[1])!.Values.clear();
        this.Configs.get(keys[1])!.Values.addRange(leverArm.Values.map(value => Math.round(value * Math.pow(10, 2)) / Math.pow(10, 2)));

        // 初始化航向偏置
        const azimuth: ClientMessage.InertialNavigationAzimuthResponse = await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.InertialNavigationAzimuthRequest(this.Configs.get(keys[2])!.InstanceId));
        this.Configs.get(keys[2])!.Values.clear();
        this.Configs.get(keys[2])!.Values.add(azimuth.Value);

        await GameObjectComponent.Default.HideAsync(instanceIds);

        TooltipComponent.Default.Clear();

        await PostProcessLayerComponent.Default.RemoveEffectAsync(volume, effect);
        await PostProcessLayerComponent.Default.RemoveVolumeAsync(volume);
    }

    /**
     * 标定Id发生变化时
     * @param current 值
     */
    private async OnIdChangedAsync(current: number, previous: number): Promise<void> {
        if (import.meta.env.PROD) {
            TooltipComponent.Default.Clear();

            await GameObjectComponent.Default.HideAsync(this.Configs.get(previous)!.InstanceId);

            await GameObjectComponent.Default.ShowAsync(this.Config.value.InstanceId);

            await OrbitCameraComponent.Default.ApplyConfigAsync(this.Config.value.ViewId);
        }

        this.ShowOrigin.value = this.Config.value.ShowOrigin;
    }

    private async OnOriginStateChangedAsync(value: boolean): Promise<void> {
        this.Config.value.ShowOrigin = value;
        if (value) {
            await GameObjectComponent.Default.ShowAsync(this.Config.value.Origin);
        } else {
            await GameObjectComponent.Default.HideAsync(this.Config.value.Origin);
        }
    }

    public async SubmitGizmosAsync(): Promise<void> {
        const values = [this.GizmosPointX.value, this.GizmosPointY.value, this.GizmosPointZ.value];
        const keys = Array.from(this.Configs.keys());
        const success = values.map(value => Math.round(value * Math.pow(10, 2)) / Math.pow(10, 2)).toString() == this.Configs.get(keys[0])!.Values.toString();
        const options = ModalOptions.Default()
            .WithPrefix('/src/components/Apps/InertialNavigation/')
            .WithType('MessageBox')
            .WithContent(success ? '标定成功' : '标定失败')
            .WithButtons(['确定']);
        await ModalComponent.Default.PopupAsync(options);
    }

    public async SubmitLeverArmAsync(): Promise<void> {
        const values = [
            this.LeverArmPointX.value,
            this.LeverArmPointY.value,
            this.LeverArmPointZ.value,
            this.LeverArmAntennaX.value,
            this.LeverArmAntennaY.value,
            this.LeverArmAntennaZ.value];
        const keys = Array.from(this.Configs.keys());
        const success = values.map(value => Math.round(value * Math.pow(10, 2)) / Math.pow(10, 2)).toString() == this.Configs.get(keys[1])!.Values.toString();
        const options = ModalOptions.Default()
            .WithPrefix('/src/components/Apps/InertialNavigation/')
            .WithType('MessageBox')
            .WithContent(success ? '标定成功' : '标定失败')
            .WithButtons(['确定']);
        await ModalComponent.Default.PopupAsync(options);
    }

    public async SubmitAzimuthAsync(): Promise<void> {
        const values = [this.AzimuthAngle.value, this.AzimuthMainAntenna.value, this.AzimuthSubAntenna.value];
        const keys = Array.from(this.Configs.keys());
        let success = values[0] == this.Configs.get(keys[2])!.Values[0] || Math.abs(this.Configs.get(keys[2])!.Values[0] - values[0]) == 360;

        if (success) {
            switch (values[0]) {
                case 0:
                case 360:
                    {
                        success = (values[1] == 0 && values[2] == 180) || (values[1] == 0 && values[2] == -180);
                        break;
                    }
                case 90:
                case -270:
                    {
                        success = (values[1] == 90 && values[2] == -90) || (values[1] == 90 && values[2] == 270);
                        break;
                    }
                case 180:
                case -180:
                    {
                        success = (values[1] == 180 && values[2] == 0) || (values[1] == -180 && values[2] == 0);
                        break;
                    }
                case 270:
                case -90:
                    {
                        success = (values[1] == 270 && values[2] == 90) || (values[1] == -90 && values[2] == 90);
                        break;
                    }
            }
        }

        const options = ModalOptions.Default()
            .WithPrefix('/src/components/Apps/InertialNavigation/')
            .WithType('MessageBox')
            .WithContent(success ? '标定成功' : '标定失败')
            .WithButtons(['确定']);
        await ModalComponent.Default.PopupAsync(options);
    }
}

/**
 * 协议帧
 */
export class ProtocolFrame {
    /**
     * 帧头
     */
    public Header: number = 0xAA55;
    /**
     * 数据长度
     */
    public Length: number = 0x4C;
    /**
     * 导航时间(ms)
     */
    public TimeCnt: number = 0;
    /**
     * X角速率(°/s)
     */
    public AngularRateX: number = 0;
    /**
     * Y角速率(°/s)
     */
    public AngularRateY: number = 0;
    /**
    * Z角速率(°/s)
    */
    public AngularRateZ: number = 0;
    /**
     * X加速度(m/s2)
     */
    public AcceleratedVelocityX: number = 0;
    /**
     * Y加速度(m/s2)
     */
    public AcceleratedVelocityY: number = 0;
    /**
     * Z加速度(m/s2)
     */
    public AcceleratedVelocityZ: number = 0;
    /**
     * 北速(m/s)
     */
    public NorthSpeed: number = 0;
    /**
     * 天速(m/s)
     */
    public SkySpeed: number = 0;
    /**
     * 东速(m/s)
     */
    public EastSpeed: number = 0;
    /**
     * 高度(m)
     */
    public Height: number = 0;
    /**
     * 经度(°) - 精度1e-7
     */
    public Longitude: number = 0;
    /**
     * 纬度(°) - 精度1e-7
     */
    public Latitude: number = 0;
    /**
     * 滚动(°)
     */
    public Roll: number = 0;
    /**
     * 航向(°)
     */
    public Yaw: number = -10;
    /**
     * 俯仰(°)
     */
    public Pitch: number = 0;
    /**
     * UTC毫秒数
     */
    public UTC: number = 0;
    /**
     * 升沉位移(mm)
     */
    public HeaveDisplacement: number = 0;
    /**
     * 校验和
     */
    public SumCheck: number = 0;


    /**
     * 工作模式
     */
    public WorkMode: number = 0;
    /**
     * 工作模式
     */
    public SelfTest: number = 0;
    /**
     * 接收机定位模式
     */
    public PosType: number = 0;
    /**
     * 接收机定位有效
     */
    public PositionOK: number = 0;
    /**
     * 接收机航向有效
     */
    public HeadingOK: number = 0;
    /**
     * 定位卫星数
     */
    public NoSV: number = 0;
    /**
     * 系统温度
     */
    public Temperature: number = 0;
    /**
     * 接收机定位精度
     */
    public HDOP: number = 0;
    /**
     * 接收机北速
     */
    public VnNorth: number = 0;
    /**
     * 接收机天速
     */
    public VnSky: number = 0;
    /**
    * 接收机东速
    */
    public VnEast: number = 0;
    /**
    * 接收机纬度 - 精度1e-7
    */
    public GPSLatitude: number = 0;
    /**
    * 接收机经度 - 精度1e-7
    */
    public GPSLongitude: number = 0;
    /**
     * 接收机高度
     */
    public GPSHeight: number = 0;
    /**
     * X陀螺零位估计
     */
    public GyrDriftX: number = 0;
    /**
     * Y陀螺零位估计
     */
    public GyrDriftY: number = 0;
    /**
     * Z陀螺零位估计
     */
    public GyrDriftZ: number = 0;
    /**
     * 气压高度
     */
    public PreHeight: number = 0;
    /**
     * 磁航向
     */
    public MagHeading: number = 0;
    /**
     * GPS航向
     */
    public GPSHeading: number = 0;
    /**
     * 组合导航PPS时刻
     */
    public PPSTime: number = 0;
    /**
     * 接收机周内毫秒
     */
    public iTow: number = 0;
}

/**
 * 协议应用配置项
 */
export class ProtocolUseConfig {
    Id: number;
    Name: string;
    Value: string;
    Unit: string;

    constructor(id: number, name: string, unit: string = '', value: string = '') {
        this.Id = id;
        this.Name = name;
        this.Value = value;
        this.Unit = unit;
    }
}

export class GPSPoint {
    /**
     * 经度(°) - 精度1e-7
     */
    public Longitude: number = 0;
    /**
     * 纬度(°) - 精度1e-7
     */
    public Latitude: number = 0;

    constructor(lng: number, lat: number) {
        this.Longitude = lng;
        this.Latitude = lat;
    }
}

export class ProtocolDefinition {
    public Id: number;
    public Name: string;
    public Value: string;
    public Reference: string;

    constructor(id: number, name: string, value: string = '', reference: string = '') {
        this.Id = id;
        this.Name = name;
        this.Value = value;
        this.Reference = reference;
    }
}

/**
 * 协议解读组件
 */
export class ProtocolComponent {
    private static instance: ProtocolComponent = new ProtocolComponent();
    /**
     * 协议解读组件
     */
    public static get Default(): ProtocolComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));

        this.watchStopHandles.push(watch(this.DataSource, this.OnDataSourceChanged.bind(this)));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public Capacity: number = 64;

    public Datas: UnwrapNestedRefs<Array<Uint8Array>> = reactive([]);

    public Data: Ref<Array<number>> = ref([]);

    public FrameIndex: number = 0;
    public Frame: UnwrapNestedRefs<ProtocolFrame> = reactive(new ProtocolFrame());

    public TracePlotPoints: UnwrapNestedRefs<Array<GPSPoint>> = reactive([]);

    public UseConfigs: UnwrapNestedRefs<Array<ProtocolUseConfig>> = reactive([
        new ProtocolUseConfig(1, '信息编号', '', '0'),
        new ProtocolUseConfig(2, '工作模式', '', '0'),
        new ProtocolUseConfig(3, '自检结果', '', '0'),
        new ProtocolUseConfig(4, 'X轴角速度', '°/s', '0.000'),
        new ProtocolUseConfig(5, 'Y轴角速度', '°/s', '0.000'),
        new ProtocolUseConfig(6, 'Z轴角速度', '°/s', '0.000'),
        new ProtocolUseConfig(7, 'X轴加速度', 'm/s2', '0.00'),
        new ProtocolUseConfig(8, 'Y轴加速度', 'm/s2', '0.00'),
        new ProtocolUseConfig(9, 'Z轴加速度', 'm/s2', '0.00'),
        new ProtocolUseConfig(10, 'X陀螺漂移', '°/h', '0.00'),
        new ProtocolUseConfig(11, 'Y陀螺漂移', '°/h', '0.00'),
        new ProtocolUseConfig(12, 'Z陀螺漂移', '°/h', '0.00'),
        new ProtocolUseConfig(13, '东向速度', 'm/s', '0.00'),
        new ProtocolUseConfig(14, '北向速度', 'm/s', '0.00'),
        new ProtocolUseConfig(15, '天向速度', 'm/s', '0.00'),
        new ProtocolUseConfig(16, '东向位移', 'm', '0.00'),
        new ProtocolUseConfig(17, '北向位移', 'm', '0.00'),
        new ProtocolUseConfig(18, '天向位移', 'm', '0.00'),
        new ProtocolUseConfig(19, '经度', '°', '0.00'),
        new ProtocolUseConfig(20, '纬度', '°', '0.00'),
        new ProtocolUseConfig(21, '高度', 'm', '0.00'),
        new ProtocolUseConfig(22, '横滚角', '°', '0.00'),
        new ProtocolUseConfig(23, '航向角', '°', '0.00'),
        new ProtocolUseConfig(24, '俯仰角', '°', '0.00'),

        new ProtocolUseConfig(101, 'POS_TYPE', '', '0'),
        new ProtocolUseConfig(102, 'POS_OK', '', '0'),
        new ProtocolUseConfig(103, 'HEADING_OK', '', '0'),
        new ProtocolUseConfig(104, '卫星数', '', '0'),
        new ProtocolUseConfig(105, 'GPS东速', 'm/s', '0.00'),
        new ProtocolUseConfig(106, 'GPS北速', 'm/s', '0.00'),
        new ProtocolUseConfig(107, 'GPS天速', 'm/s', '0.00'),
        new ProtocolUseConfig(108, '定位进度', 'm', '0.000'),
        new ProtocolUseConfig(109, 'GPS经度', '°', '0.00000'),
        new ProtocolUseConfig(110, 'GPS纬度', '°', '0.00000'),
        new ProtocolUseConfig(111, 'GPS高度', 'm', '0.00'),
        new ProtocolUseConfig(112, '气压高度', 'm', '0.00'),
        new ProtocolUseConfig(113, 'GPS航向', '°', '0.00'),
        new ProtocolUseConfig(114, '升沉', 'mm', '0'),
        new ProtocolUseConfig(115, 'UTC时间', '', ''),
    ]);


    public ShowDocument: Ref<boolean> = ref(false);
    public ShowTool: Ref<boolean> = ref(false);

    public DataSource: Ref<string> = ref('Device');

    public SimulatedData: Array<Uint8Array> = [
        new Uint8Array([0x55, 0xAA, 0x4C, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x61]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x66, 0xC4, 0xBC, 0x63, 0x2E, 0xA8, 0x3B, 0x97, 0xF6, 0x88, 0xBC, 0x05, 0x4F, 0xDB, 0x3A, 0xD2, 0xD4, 0xC4, 0x3E, 0xFC, 0x64, 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0xFA]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x34, 0xBF, 0xBD, 0x14, 0x1A, 0x11, 0x3B, 0xD5, 0xBE, 0x70, 0xBD, 0xEF, 0xB6, 0xE1, 0xBA, 0x78, 0x3A, 0x8A, 0x40, 0x30, 0xC7, 0x1F, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0xDC]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0xB0, 0x0E, 0xBE, 0xD7, 0x19, 0xA6, 0xBC, 0xF4, 0x9C, 0xE0, 0xBD, 0x05, 0xFF, 0x5D, 0xBC, 0x40, 0xB0, 0x0E, 0x41, 0xC9, 0x2B, 0xA6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x3E]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAB, 0x5F, 0xBD, 0x74, 0x19, 0xFC, 0xBC, 0xFD, 0x17, 0xA6, 0xBD, 0x31, 0x1F, 0xAC, 0xBC, 0x51, 0xEC, 0x1C, 0x41, 0xC0, 0x75, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x6F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0x62, 0x47, 0x3C, 0x5A, 0x18, 0xBB, 0xBC, 0x61, 0xC1, 0xD7, 0xBC, 0x08, 0x79, 0xAE, 0xBC, 0xB5, 0x70, 0x1C, 0x41, 0x25, 0x90, 0xBA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x19]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x1E, 0xAA, 0xBD, 0xCE, 0xAB, 0x6E, 0xBC, 0xB7, 0x66, 0x0D, 0xBD, 0x77, 0xCA, 0xB0, 0xBC, 0x76, 0x72, 0x1C, 0x41, 0xB0, 0x36, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0xF1]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x13, 0x8B, 0xBD, 0x19, 0x63, 0xFD, 0xBB, 0x21, 0xBB, 0x38, 0x3D, 0x63, 0xDA, 0xC1, 0xBC, 0x75, 0x6D, 0x1C, 0x41, 0xD5, 0xD1, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0xC0]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x26, 0x70, 0xBB, 0x1E, 0x84, 0xD0, 0xBC, 0x50, 0xB7, 0xF9, 0x3C, 0x71, 0xB6, 0xAE, 0xBC, 0x82, 0x6D, 0x1C, 0x41, 0x5F, 0x73, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x7F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x57, 0x93, 0xBD, 0x09, 0xE2, 0xD4, 0x3C, 0xB0, 0x6A, 0x0D, 0xBD, 0xDD, 0x9C, 0x9D, 0xBC, 0x09, 0x73, 0x1C, 0x41, 0x83, 0x08, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x5E]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x64, 0xC6, 0x3A, 0x67, 0xD8, 0xE0, 0x3C, 0x70, 0x8F, 0x0D, 0xBC, 0xA0, 0x61, 0x9D, 0xBC, 0x02, 0x77, 0x1C, 0x41, 0x83, 0x8E, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x87]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xA8, 0xAC, 0x3D, 0xB6, 0x84, 0xF7, 0xBC, 0x31, 0x90, 0x96, 0xBD, 0x02, 0x3E, 0xBD, 0xBC, 0xE2, 0x76, 0x1C, 0x41, 0x62, 0xB8, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x4F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xBF, 0x8A, 0x3D, 0x98, 0x9D, 0x31, 0xBD, 0x52, 0x61, 0x5E, 0xBD, 0x67, 0x56, 0xB7, 0xBC, 0xB2, 0x72, 0x1C, 0x41, 0xB8, 0x27, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x74]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0x8D, 0x9E, 0x3D, 0x88, 0x8B, 0x1A, 0xBD, 0x68, 0x6B, 0x28, 0x3D, 0x78, 0x4E, 0xB7, 0xBC, 0xF8, 0x73, 0x1C, 0x41, 0x43, 0x79, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x69]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xA0, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x44, 0x1E, 0xC7, 0x3B, 0x5A, 0x28, 0x45, 0x3C, 0x4E, 0x9D, 0x5F, 0x3D, 0xE5, 0xA6, 0x93, 0xBC, 0x31, 0x6C, 0x1C, 0x41, 0x37, 0x68, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0xF4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x6D, 0x0D, 0xBE, 0xA8, 0xA8, 0x12, 0xBD, 0x69, 0x68, 0x19, 0xBD, 0x52, 0x60, 0x89, 0xBC, 0x68, 0x6C, 0x1C, 0x41, 0xEB, 0xD9, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x79]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0xF9, 0x50, 0xBE, 0xB6, 0xC8, 0x9E, 0xBD, 0x3F, 0x1C, 0x6F, 0xBD, 0x79, 0xF1, 0xA1, 0xBC, 0x90, 0x6C, 0x1C, 0x41, 0x65, 0x0A, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0xE4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xBE, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, 0x7E, 0x3D, 0x99, 0xBC, 0x74, 0xD6, 0x9D, 0xBD, 0x3E, 0x67, 0x99, 0x3C, 0xC0, 0x3F, 0xA8, 0xBC, 0xDE, 0x6F, 0x1C, 0x41, 0xAB, 0xBD, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x08]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xC8, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0xE4, 0xBB, 0x6E, 0x3D, 0x10, 0x8B, 0x3A, 0xBD, 0xF8, 0x1F, 0x48, 0x3B, 0xA7, 0x8E, 0xB8, 0xBC, 0xFE, 0x70, 0x1C, 0x41, 0x69, 0x7C, 0xB1, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x00, 0x00, 0x00, 0x97]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xF3, 0x31, 0xBE, 0xD6, 0x72, 0x85, 0xBD, 0xBC, 0xA2, 0xD4, 0xBD, 0x1E, 0x80, 0xA9, 0xBC, 0x53, 0x6F, 0x1C, 0x41, 0x07, 0x49, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0xCB]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xDC, 0x00, 0x00, 0x00, 0xC0, 0x73, 0xA6, 0x40, 0x4C, 0xFD, 0xDE, 0xBD, 0x41, 0x7B, 0xA8, 0xBD, 0xE8, 0xFD, 0xB4, 0xBC, 0x88, 0x31, 0xA6, 0xBC, 0x79, 0x70, 0x1C, 0x41, 0x93, 0x81, 0xB1, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x00, 0x00, 0xC7]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0xCD, 0xF4, 0x3D, 0x51, 0x52, 0x9B, 0xBD, 0x82, 0xCB, 0xD5, 0x3D, 0x25, 0xD3, 0x88, 0xBC, 0xF7, 0x6C, 0x1C, 0x41, 0xD8, 0x2B, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD3, 0x00, 0x00, 0x00, 0xA8]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x72, 0xB5, 0xE0, 0x3D, 0x50, 0x73, 0x8F, 0xBD, 0xC1, 0xAF, 0x75, 0x3C, 0x8F, 0xC1, 0xAE, 0xBC, 0x85, 0x72, 0x1C, 0x41, 0x60, 0xD0, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0xC3]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x01, 0x9E, 0x3D, 0x18, 0x72, 0x4F, 0x3B, 0xBE, 0x12, 0xBD, 0xBC, 0xF2, 0x37, 0xC2, 0xBC, 0xA4, 0x6F, 0x1C, 0x41, 0x17, 0xE4, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x00, 0x00, 0x00, 0xE6]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x97, 0xF2, 0x3B, 0xA4, 0x4E, 0x47, 0xBC, 0x26, 0x2C, 0x2A, 0xBD, 0xC2, 0xD1, 0xB7, 0xBC, 0x0F, 0x6A, 0x1C, 0x41, 0xB2, 0x57, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x58]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x0E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x38, 0xAB, 0xBD, 0x8E, 0xAF, 0x7D, 0xBC, 0x25, 0x4B, 0x19, 0xBD, 0x1B, 0x4C, 0xA6, 0xBC, 0x2D, 0x63, 0x1C, 0x41, 0xB4, 0x55, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x00, 0x00, 0xB3]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x8D, 0xD8, 0xBD, 0x6E, 0x3F, 0x6B, 0xBD, 0x4E, 0x24, 0x1F, 0x3C, 0x45, 0x18, 0x97, 0xBC, 0x91, 0x65, 0x1C, 0x41, 0x41, 0xE5, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x13]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x22, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0xE5, 0xC9, 0xBD, 0xDA, 0x30, 0xA2, 0xBD, 0xA9, 0x76, 0x88, 0xBD, 0x10, 0x88, 0xA7, 0xBC, 0xE2, 0x62, 0x1C, 0x41, 0x1F, 0x3D, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x87]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0xF5, 0x9A, 0x3C, 0xB2, 0x02, 0x53, 0xBD, 0x42, 0xB7, 0xCB, 0xBD, 0x5E, 0x5B, 0xA0, 0xBC, 0xAF, 0x63, 0x1C, 0x41, 0x8B, 0x8A, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x8E]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x36, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA6, 0x6C, 0xCB, 0xBC, 0x68, 0x2E, 0x49, 0xBD, 0xF4, 0xC2, 0x52, 0xBD, 0xDB, 0x5A, 0xBF, 0xBC, 0xD5, 0x69, 0x1C, 0x41, 0xBC, 0xEA, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x00, 0x00, 0x84]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x6A, 0x48, 0xBD, 0xA1, 0x4B, 0x13, 0xBD, 0xB2, 0x88, 0xF5, 0xBC, 0x5A, 0xE5, 0xA4, 0xBC, 0x56, 0x62, 0x1C, 0x41, 0xFD, 0x96, 0xB1, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x01, 0x00, 0x00, 0x13]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x4A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0xC6, 0x74, 0xBD, 0x02, 0x8B, 0x24, 0xBD, 0x04, 0x40, 0x20, 0xBD, 0xC8, 0x13, 0xAD, 0xBC, 0x63, 0x5B, 0x1C, 0x41, 0x5C, 0x4E, 0xAD, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x01, 0x00, 0x00, 0xA4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5, 0x5D, 0x9F, 0xBD, 0x05, 0xF5, 0xA6, 0xBC, 0x80, 0x5D, 0xCB, 0xBD, 0x0F, 0xEB, 0x97, 0xBC, 0xE3, 0x65, 0x1C, 0x41, 0x19, 0xE3, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xE6, 0x23, 0x3E, 0x20, 0x9E, 0x51, 0x3C, 0xAB, 0xB4, 0xB8, 0xBD, 0x80, 0xF1, 0xAD, 0xBC, 0x91, 0x6E, 0x1C, 0x41, 0xAA, 0x9E, 0xBF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x01, 0x00, 0x00, 0x95]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x68, 0x01, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x0E, 0x69, 0x03, 0x3E, 0x84, 0x60, 0xE3, 0xBC, 0x40, 0xEB, 0x6C, 0xBD, 0x05, 0xD9, 0xC6, 0xBC, 0x59, 0x6B, 0x1C, 0x41, 0xBD, 0xBB, 0xBA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x7C]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x72, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x4D, 0xF8, 0xBD, 0x2F, 0xE8, 0xD9, 0xBD, 0xFB, 0xB4, 0x28, 0xBD, 0xF1, 0xC5, 0xA3, 0xBC, 0xB4, 0x70, 0x1C, 0x41, 0x12, 0xEF, 0xAD, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x01, 0x00, 0x00, 0xE2]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x7C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x08, 0xED, 0xBD, 0x3B, 0x97, 0x5D, 0xBD, 0x19, 0xD5, 0x21, 0xBD, 0x56, 0xF0, 0x88, 0xBC, 0xB4, 0x70, 0x1C, 0x41, 0x2D, 0x46, 0xAB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x01, 0x00, 0x00, 0x61]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x86, 0x01, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0xAE, 0x80, 0x5A, 0xBD, 0xC6, 0x5B, 0x15, 0xBC, 0x1C, 0x9E, 0x88, 0xBC, 0x7D, 0x35, 0x54, 0xBC, 0xD3, 0x6E, 0x1C, 0x41, 0x15, 0xDF, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x4F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x90, 0x01, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0xC3, 0x17, 0x16, 0xBD, 0xF0, 0x84, 0xE9, 0xBC, 0x84, 0x73, 0x1E, 0xBB, 0xAD, 0x61, 0xAB, 0xBC, 0x7C, 0x63, 0x1C, 0x41, 0x61, 0xE2, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7D, 0x01, 0x00, 0x00, 0xE6]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x9A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x7F, 0x2E, 0x3B, 0x06, 0x5F, 0xA2, 0xBC, 0x0F, 0x0F, 0xF7, 0x3C, 0x26, 0xA4, 0xB2, 0xBC, 0x41, 0x63, 0x1C, 0x41, 0xC7, 0x75, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0xE3]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xA4, 0x01, 0x00, 0x00, 0xC0, 0x73, 0xA6, 0x40, 0xFF, 0x4C, 0x0E, 0xBD, 0xB2, 0xCB, 0x66, 0xBD, 0x2C, 0x6C, 0x3B, 0x3C, 0x8A, 0x83, 0xBA, 0xBC, 0x99, 0x6A, 0x1C, 0x41, 0x30, 0xAA, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0x10]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xAE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x5B, 0xEB, 0xBC, 0x2F, 0x0F, 0x98, 0xBD, 0xAE, 0xB1, 0x66, 0xBD, 0x52, 0x5E, 0xA6, 0xBC, 0xC5, 0x67, 0x1C, 0x41, 0xBB, 0xF4, 0xAF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x01, 0x00, 0x00, 0xA4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xB8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0x47, 0x88, 0x3D, 0x6E, 0xA5, 0xFC, 0xBC, 0xA9, 0xF1, 0x89, 0xBD, 0xE4, 0x23, 0xA6, 0xBC, 0xE5, 0x66, 0x1C, 0x41, 0x62, 0x69, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x01, 0x00, 0x00, 0xDB]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xC2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x5A, 0x2A, 0x3D, 0xE8, 0x0C, 0x54, 0xBD, 0x34, 0x51, 0xDF, 0xBC, 0x3C, 0x3C, 0xA1, 0xBC, 0x84, 0x66, 0x1C, 0x41, 0x17, 0x82, 0xC4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x01, 0x00, 0x00, 0xE1]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xCC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xB0, 0xEA, 0xBA, 0x23, 0x3E, 0x8B, 0xBD, 0x00, 0xA0, 0xB0, 0x37, 0x5F, 0xB1, 0xB9, 0xBC, 0x41, 0x6C, 0x1C, 0x41, 0xD0, 0x46, 0xBE, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB9, 0x01, 0x00, 0x00, 0x37]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xD6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x33, 0x53, 0xBC, 0xAA, 0x46, 0x6E, 0xBD, 0xDA, 0x0A, 0xF0, 0xBC, 0xAC, 0x6B, 0xC4, 0xBC, 0x53, 0x68, 0x1C, 0x41, 0x7C, 0xED, 0xAE, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x01, 0x00, 0x00, 0x27]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x97, 0x2A, 0xBD, 0xBF, 0xFB, 0xBB, 0xBD, 0xDB, 0xF0, 0x95, 0x3C, 0xA5, 0x29, 0xAB, 0xBC, 0xAB, 0x70, 0x1C, 0x41, 0x55, 0x01, 0xBC, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x01, 0x00, 0x00, 0xC3]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xEA, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x11, 0x82, 0x3D, 0xB2, 0x5C, 0xC2, 0xBD, 0xFC, 0xFA, 0x83, 0x3D, 0xDE, 0x57, 0xB3, 0xBC, 0x05, 0x6D, 0x1C, 0x41, 0xA5, 0xE3, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD7, 0x01, 0x00, 0x00, 0x38]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xF4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xE2, 0x29, 0x3B, 0x3C, 0x9F, 0x87, 0xBD, 0xFE, 0x1A, 0x31, 0x3D, 0x08, 0xEA, 0x99, 0xBC, 0xFD, 0x63, 0x1C, 0x41, 0x88, 0x7D, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE1, 0x01, 0x00, 0x00, 0x12]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x30, 0x97, 0x3B, 0xC0, 0x32, 0x6E, 0xBD, 0x63, 0x08, 0xDD, 0x3D, 0x8A, 0xCD, 0xB3, 0xBC, 0x4B, 0x61, 0x1C, 0x41, 0xEA, 0x5D, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB, 0x01, 0x00, 0x00, 0xBC]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x1C, 0xB0, 0xBD, 0xEE, 0xCE, 0x1F, 0xBD, 0x72, 0xCC, 0x9A, 0x3D, 0x5A, 0xC2, 0x93, 0xBC, 0x9D, 0x62, 0x1C, 0x41, 0x66, 0x6E, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x01, 0x00, 0x00, 0x69]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0xB0, 0x57, 0xBE, 0xDF, 0x0A, 0x21, 0x3D, 0x7E, 0x2C, 0x9F, 0x3C, 0x8C, 0xDC, 0xAB, 0xBC, 0x63, 0x69, 0x1C, 0x41, 0x08, 0xFF, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x21]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x78, 0xB7, 0xBD, 0x2E, 0xD8, 0xE5, 0xBC, 0xE9, 0x9C, 0x07, 0x3D, 0x51, 0x34, 0xA8, 0xBC, 0xD4, 0x62, 0x1C, 0x41, 0xDD, 0x34, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x9A]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0xC3, 0x85, 0xBD, 0xF4, 0x92, 0xE7, 0xBD, 0x61, 0x4B, 0x80, 0x3C, 0x45, 0x57, 0xB4, 0xBC, 0x54, 0x62, 0x1C, 0x41, 0x6B, 0x45, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x07]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x30, 0x02, 0x00, 0x00, 0xBA, 0x01, 0x00, 0x00, 0x39, 0x9A, 0x9C, 0xBD, 0x72, 0xD8, 0xDC, 0xBD, 0xF2, 0xCE, 0xD9, 0xBC, 0xF5, 0x20, 0xAD, 0xBC, 0x53, 0x5D, 0x1C, 0x41, 0xA4, 0x8F, 0xAA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x02, 0x00, 0x00, 0x61]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x3A, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x8B, 0x81, 0xBD, 0x5D, 0x82, 0x86, 0xBD, 0x64, 0xE4, 0x8F, 0xBD, 0xB3, 0x53, 0x8B, 0xBC, 0x8B, 0x60, 0x1C, 0x41, 0xE9, 0x0A, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x02, 0x00, 0x00, 0xCA]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x44, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x92, 0x39, 0x3D, 0xB6, 0x8E, 0xAB, 0x3C, 0x94, 0xBD, 0xD8, 0xBD, 0x76, 0x13, 0x97, 0xBC, 0x0B, 0x66, 0x1C, 0x41, 0xE4, 0x66, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x51]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x4E, 0x02, 0x00, 0x00, 0x4E, 0x02, 0x00, 0x00, 0xAA, 0xE3, 0x90, 0x3D, 0xE8, 0x90, 0xF9, 0x3B, 0x91, 0x53, 0xED, 0xBD, 0x47, 0x99, 0x90, 0xBC, 0x5B, 0x68, 0x1C, 0x41, 0x05, 0x85, 0xBC, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x02, 0x00, 0x00, 0x8C]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x58, 0x02, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0xDD, 0x71, 0xAA, 0x3B, 0xB5, 0x93, 0x53, 0xBD, 0x1C, 0xDD, 0x40, 0xBD, 0x85, 0x52, 0xC1, 0xBC, 0xA2, 0x67, 0x1C, 0x41, 0xE5, 0x07, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x17]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x62, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xA5, 0x8F, 0xBD, 0xC2, 0xF5, 0x9A, 0xBD, 0xB0, 0x02, 0x08, 0x3C, 0xC4, 0xBC, 0xB7, 0xBC, 0x8E, 0x69, 0x1C, 0x41, 0x33, 0x0F, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x02, 0x00, 0x00, 0x39]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x6C, 0x02, 0x00, 0x00, 0xC0, 0x73, 0xA6, 0x40, 0xA1, 0xBF, 0x81, 0xBD, 0xF9, 0xA2, 0x11, 0xBD, 0x3E, 0xA6, 0x82, 0xBC, 0x87, 0x18, 0xBA, 0xBC, 0x8B, 0x68, 0x1C, 0x41, 0x69, 0x2B, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x45]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x76, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x07, 0xBE, 0x3C, 0x78, 0x2A, 0xBD, 0x34, 0x64, 0x7B, 0xBD, 0xBA, 0x23, 0x8E, 0xBC, 0x78, 0x60, 0x1C, 0x41, 0xB4, 0xC8, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x27]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xAD, 0xF6, 0xBD, 0xCF, 0xC6, 0x91, 0xBD, 0x21, 0x98, 0xBC, 0xBC, 0xC5, 0x1E, 0x8D, 0xBC, 0xAE, 0x61, 0x1C, 0x41, 0xF4, 0x93, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x02, 0x00, 0x00, 0x53]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x8A, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x41, 0x2D, 0xBC, 0xE0, 0x70, 0xFD, 0xBB, 0xC0, 0xBC, 0x88, 0xBC, 0x8B, 0xA5, 0xAE, 0xBC, 0xBB, 0x5E, 0x1C, 0x41, 0xDE, 0xF2, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0xEC]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x94, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xA5, 0x4F, 0x3D, 0xFE, 0xB8, 0x80, 0x3C, 0x96, 0xFA, 0x0F, 0xBD, 0x70, 0xE5, 0xB3, 0xBC, 0xE9, 0x5C, 0x1C, 0x41, 0x28, 0xD2, 0xB0, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x74]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x9E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xA3, 0x29, 0x3D, 0xE4, 0x5A, 0x05, 0x3D, 0x7F, 0x81, 0x84, 0x3B, 0xD5, 0xF7, 0xB3, 0xBC, 0x07, 0x5C, 0x1C, 0x41, 0x9F, 0xE5, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x02, 0x00, 0x00, 0x39]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xA8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xCA, 0x43, 0xBC, 0x36, 0xD3, 0x82, 0x3C, 0x1E, 0x1D, 0x35, 0x3D, 0xAD, 0x18, 0x96, 0xBC, 0x85, 0x60, 0x1C, 0x41, 0xCC, 0xA6, 0xC2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00, 0xF4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xB2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x32, 0x96, 0xBD, 0x4C, 0x9E, 0x18, 0xBD, 0x0F, 0xD4, 0xC2, 0x3B, 0xE4, 0x1B, 0xA2, 0xBC, 0x4E, 0x5D, 0x1C, 0x41, 0x10, 0x1F, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x02, 0x00, 0x00, 0xCF]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xBC, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x9D, 0x94, 0xBD, 0x8A, 0x3B, 0xA3, 0xBC, 0x1E, 0xC2, 0x4D, 0xBC, 0x0C, 0xF3, 0x9F, 0xBC, 0xED, 0x5A, 0x1C, 0x41, 0x6B, 0x31, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0x02, 0x00, 0x00, 0x85]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xC6, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7A, 0xB2, 0x33, 0x3D, 0xC8, 0xB3, 0xA6, 0xBC, 0x9B, 0x8E, 0x42, 0xBD, 0x4B, 0x79, 0xB7, 0xBC, 0xCF, 0x6C, 0x1C, 0x41, 0x08, 0x32, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0x02, 0x00, 0x00, 0x6B]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xD0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0xDD, 0x5C, 0xBC, 0x48, 0x37, 0x3C, 0xBD, 0x6E, 0xBB, 0xEF, 0xBD, 0x3A, 0x87, 0xB5, 0xBC, 0xAD, 0x75, 0x1C, 0x41, 0xAB, 0x0C, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBD, 0x02, 0x00, 0x00, 0xD7]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xDA, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x39, 0x57, 0xBD, 0x04, 0xEE, 0x48, 0xBD, 0xF8, 0x8C, 0x72, 0xBD, 0x76, 0x83, 0xA9, 0xBC, 0x5F, 0x69, 0x1C, 0x41, 0xDB, 0x40, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x02, 0x00, 0x00, 0xA0]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xE4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xCD, 0x0C, 0xBD, 0xB4, 0x4F, 0xA5, 0xBD, 0x9A, 0x15, 0x6C, 0xBD, 0x73, 0xBB, 0xA2, 0xBC, 0xC2, 0x64, 0x1C, 0x41, 0x6E, 0x68, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1, 0x02, 0x00, 0x00, 0x45]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xEE, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xBF, 0x0B, 0xBC, 0xB6, 0xF6, 0x1E, 0xBE, 0x7F, 0x0A, 0xD1, 0xBD, 0x1F, 0x39, 0xAB, 0xBC, 0x51, 0x62, 0x1C, 0x41, 0x30, 0xDA, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x02, 0x00, 0x00, 0x51]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xF8, 0x02, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x07, 0xBB, 0x02, 0x3D, 0x23, 0x97, 0x07, 0xBE, 0x10, 0x35, 0x14, 0x3B, 0x24, 0x3A, 0xAD, 0xBC, 0x4F, 0x5F, 0x1C, 0x41, 0x4A, 0x3A, 0xA9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE5, 0x02, 0x00, 0x00, 0x01]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x43, 0x6A, 0xBD, 0x32, 0x3E, 0xE2, 0xBC, 0xAE, 0xFE, 0x03, 0xBC, 0xBC, 0x46, 0x91, 0xBC, 0x88, 0x63, 0x1C, 0x41, 0x05, 0x7A, 0xB0, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0x02, 0x00, 0x00, 0x40]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x44, 0x23, 0xBD, 0xA7, 0x2C, 0x08, 0xBD, 0xA0, 0xB6, 0x64, 0xBD, 0xD9, 0x4C, 0x9A, 0xBC, 0x7D, 0x63, 0x1C, 0x41, 0x2E, 0x99, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x02, 0x00, 0x00, 0x31]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x16, 0x03, 0x00, 0x00, 0x16, 0x03, 0x00, 0x00, 0xFD, 0x41, 0x4C, 0x3D, 0x6F, 0xCE, 0xF9, 0xBC, 0x38, 0xCE, 0x90, 0x3C, 0x19, 0xD7, 0xB8, 0xBC, 0x8A, 0x64, 0x1C, 0x41, 0x1C, 0x33, 0xBD, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x07]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x20, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x37, 0x67, 0x10, 0x3D, 0x83, 0x11, 0x95, 0xBD, 0x72, 0xA9, 0x62, 0x3D, 0x7D, 0x6E, 0xBE, 0xBC, 0xFC, 0x63, 0x1C, 0x41, 0xAD, 0x8D, 0xB1, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x03, 0x00, 0x00, 0x64]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x2A, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0xF8, 0x71, 0xBC, 0xAC, 0x9F, 0x04, 0xBE, 0xB4, 0x7F, 0x07, 0x3D, 0xFD, 0x58, 0x9C, 0xBC, 0x42, 0x66, 0x1C, 0x41, 0x5C, 0xC8, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x03, 0x00, 0x00, 0xCC]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x34, 0x03, 0x00, 0x00, 0xC0, 0x73, 0xA6, 0x40, 0x7C, 0x5F, 0x23, 0xBD, 0xF8, 0x5C, 0x55, 0xBD, 0xE8, 0x9D, 0x15, 0xBB, 0x95, 0xFD, 0x98, 0xBC, 0xD0, 0x65, 0x1C, 0x41, 0x07, 0x7A, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x03, 0x00, 0x00, 0x24]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x3E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x3A, 0xFA, 0xBD, 0x56, 0x6F, 0xFD, 0xBC, 0xD8, 0x2A, 0x3A, 0xBC, 0x69, 0xF2, 0x96, 0xBC, 0x58, 0x5E, 0x1C, 0x41, 0xCE, 0x2C, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x03, 0x00, 0x00, 0x57]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x49, 0xE5, 0xBD, 0xB4, 0x37, 0x05, 0xBD, 0xFA, 0x85, 0x23, 0xBD, 0x8F, 0xAD, 0xBC, 0xBC, 0x87, 0x5F, 0x1C, 0x41, 0x73, 0x68, 0xB8, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x03, 0x00, 0x00, 0x53]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x07, 0x6A, 0xBD, 0xBF, 0x82, 0xD5, 0xBC, 0x78, 0x71, 0x8F, 0xBD, 0x1F, 0x3C, 0xC3, 0xBC, 0x2D, 0x60, 0x1C, 0x41, 0x4F, 0xF7, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x03, 0x00, 0x00, 0x1F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x5C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x03, 0x12, 0x3B, 0x21, 0xC3, 0xB3, 0xBD, 0xA6, 0x32, 0x07, 0xBD, 0xBB, 0xAF, 0xA1, 0xBC, 0xE3, 0x63, 0x1C, 0x41, 0xF6, 0x79, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0x00, 0x00, 0x21]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x66, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xE2, 0x8D, 0x3B, 0x80, 0xFE, 0xE7, 0xBD, 0x50, 0xA9, 0x53, 0xBD, 0xE2, 0xD1, 0x9D, 0xBC, 0x06, 0x66, 0x1C, 0x41, 0xD8, 0x60, 0xBB, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x03, 0x00, 0x00, 0xF5]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x70, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x80, 0xBB, 0xBD, 0x1C, 0x17, 0xA9, 0xBD, 0x39, 0xB1, 0xD6, 0xBD, 0xBD, 0xB0, 0xA8, 0xBC, 0x11, 0x69, 0x1C, 0x41, 0x9E, 0xBC, 0xBF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x03, 0x00, 0x00, 0x96]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x7A, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x7D, 0x8A, 0x3D, 0xD4, 0xD3, 0x17, 0xBD, 0x02, 0xB6, 0x29, 0xBC, 0xBE, 0x91, 0xB7, 0xBC, 0x92, 0x69, 0x1C, 0x41, 0xC6, 0xA0, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x03, 0x00, 0x00, 0xC5]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x84, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD7, 0x43, 0x24, 0x3E, 0x7E, 0x03, 0x9D, 0xBD, 0x00, 0x2B, 0xA8, 0x39, 0xAB, 0x2C, 0xB2, 0xBC, 0x1F, 0x6D, 0x1C, 0x41, 0x23, 0x2E, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x03, 0x00, 0x00, 0x19]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x8E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0x26, 0x03, 0x3D, 0x1E, 0x81, 0x8F, 0xBD, 0x15, 0x82, 0xA8, 0xBC, 0x63, 0x1F, 0xCB, 0xBC, 0xEE, 0x6E, 0x1C, 0x41, 0x17, 0x34, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0x03, 0x00, 0x00, 0x5A]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x98, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x8C, 0x9F, 0xBD, 0x7C, 0xF8, 0x40, 0xBD, 0x29, 0xA5, 0xC9, 0x3C, 0x03, 0x7F, 0xB1, 0xBC, 0xDC, 0x64, 0x1C, 0x41, 0x2E, 0x11, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x03, 0x00, 0x00, 0xBC]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xA2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x7C, 0xA0, 0xBD, 0xA8, 0x3B, 0x8C, 0xBD, 0x60, 0x69, 0x26, 0x3B, 0xB2, 0xD4, 0xA9, 0xBC, 0xE9, 0x61, 0x1C, 0x41, 0x1D, 0x81, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x03, 0x00, 0x00, 0x6F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xAC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x34, 0x77, 0xBD, 0x0D, 0x5A, 0x91, 0xBD, 0xE4, 0x28, 0xF0, 0xBB, 0xC8, 0xB5, 0x9F, 0xBC, 0x17, 0x64, 0x1C, 0x41, 0xD1, 0x68, 0xB2, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x03, 0x00, 0x00, 0x81]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xB6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x39, 0x13, 0xBE, 0x52, 0x9E, 0x28, 0xBE, 0x88, 0x21, 0x77, 0xBD, 0xD1, 0x7B, 0x90, 0xBC, 0x3E, 0x60, 0x1C, 0x41, 0x01, 0xB0, 0xAD, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0x03, 0x00, 0x00, 0xB6]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xC0, 0x03, 0x00, 0x00, 0x4A, 0x03, 0x00, 0x00, 0x78, 0xD4, 0xB3, 0xBC, 0xC0, 0x0D, 0x16, 0xBE, 0x02, 0x7F, 0xE2, 0xBD, 0x46, 0x92, 0xA8, 0xBC, 0xE2, 0x5F, 0x1C, 0x41, 0xEB, 0x02, 0xB1, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAD, 0x03, 0x00, 0x00, 0x3D]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xCA, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0x81, 0xBE, 0x3D, 0xF8, 0x22, 0x5E, 0x3C, 0xC6, 0x8C, 0x93, 0xBD, 0x8A, 0x0F, 0xB1, 0xBC, 0x63, 0x6B, 0x1C, 0x41, 0xDC, 0x25, 0xBF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x03, 0x00, 0x00, 0x9F]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xD4, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0xB5, 0x6F, 0x3D, 0xFE, 0x4D, 0x7E, 0x3D, 0xD6, 0x81, 0xD2, 0xBD, 0x57, 0xFC, 0xC0, 0xBC, 0x60, 0x6F, 0x1C, 0x41, 0x6E, 0xA5, 0xC6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x03, 0x00, 0x00, 0x6E]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xDE, 0x03, 0x00, 0x00, 0xDE, 0x03, 0x00, 0x00, 0x30, 0x32, 0xE5, 0x3C, 0xC0, 0x63, 0xDE, 0xBB, 0x5A, 0x68, 0x0E, 0xBE, 0x58, 0xF7, 0xAB, 0xBC, 0x7E, 0x68, 0x1C, 0x41, 0x8D, 0xF8, 0xC0, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCB, 0x03, 0x00, 0x00, 0x24]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xE8, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x9D, 0x23, 0x85, 0xBD, 0xE8, 0xBE, 0xE6, 0xBA, 0x70, 0x21, 0x23, 0xBE, 0x56, 0x78, 0xB7, 0xBC, 0xF2, 0x68, 0x1C, 0x41, 0x1B, 0x7C, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x03, 0x00, 0x00, 0x5D]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xF2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xC8, 0xC7, 0xBB, 0x15, 0x0F, 0x64, 0x3C, 0x62, 0x4E, 0xD6, 0xBD, 0x9A, 0xC9, 0xAE, 0xBC, 0xF1, 0x67, 0x1C, 0x41, 0xB9, 0xF0, 0xBA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0x03, 0x00, 0x00, 0xD6]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xFC, 0x03, 0x00, 0x00, 0xC0, 0x73, 0xA6, 0x40, 0xD6, 0xDA, 0x4A, 0x3D, 0x50, 0xA9, 0xA5, 0xBC, 0x9E, 0x4B, 0x7A, 0x3C, 0xBE, 0xC0, 0xAB, 0xBC, 0x35, 0x64, 0x1C, 0x41, 0xBD, 0x32, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x03, 0x00, 0x00, 0x3C]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xC9, 0xAF, 0x3C, 0xE0, 0x22, 0x00, 0xBD, 0x15, 0xA1, 0x36, 0xBD, 0xE5, 0x4E, 0xB7, 0xBC, 0x14, 0x68, 0x1C, 0x41, 0x66, 0x51, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF3, 0x03, 0x00, 0x00, 0xF2]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x89, 0x49, 0xBC, 0xC6, 0x95, 0x5E, 0xBD, 0xE6, 0xFC, 0xE6, 0xBD, 0x33, 0x0E, 0xB4, 0xBC, 0x5F, 0x69, 0x1C, 0x41, 0x8D, 0x36, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x03, 0x00, 0x00, 0xD0]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x1A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x0E, 0x8A, 0x3C, 0x20, 0x26, 0x5E, 0xBD, 0x2E, 0xE6, 0xC2, 0xBD, 0xD8, 0x5E, 0xA0, 0xBC, 0x67, 0x62, 0x1C, 0x41, 0xCA, 0x8D, 0xA5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x50]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x24, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xF2, 0x87, 0x3D, 0x3C, 0x7F, 0x6F, 0xBC, 0x6D, 0x78, 0xC6, 0xBD, 0x4E, 0x27, 0x97, 0xBC, 0x38, 0x65, 0x1C, 0x41, 0xB1, 0x6C, 0xB0, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x04, 0x00, 0x00, 0x93]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x2E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x7A, 0xC0, 0x3C, 0x20, 0x68, 0xA3, 0xBC, 0xD7, 0xAF, 0x89, 0xBD, 0xC7, 0x96, 0xBB, 0xBC, 0xFC, 0x65, 0x1C, 0x41, 0xBC, 0x15, 0xBA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x04, 0x00, 0x00, 0xCA]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x38, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x17, 0xBD, 0xC0, 0x42, 0x12, 0x3C, 0xD6, 0x89, 0x9A, 0xBC, 0xE1, 0xB9, 0xB2, 0xBC, 0x50, 0x66, 0x1C, 0x41, 0x0D, 0xB2, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x04, 0x00, 0x00, 0x61]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xDD, 0x13, 0xBC, 0xDC, 0xEB, 0xFF, 0x3C, 0x5B, 0x1F, 0x6C, 0xBD, 0x70, 0x33, 0xAF, 0xBC, 0xB5, 0x65, 0x1C, 0x41, 0x4C, 0x91, 0xB4, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00, 0xC3]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x4C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x60, 0xF7, 0x3C, 0x9C, 0x33, 0xBB, 0xBC, 0x2B, 0x9F, 0x32, 0xBD, 0xF2, 0x47, 0x9D, 0xBC, 0x0F, 0x6A, 0x1C, 0x41, 0x11, 0x33, 0xBE, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x04, 0x00, 0x00, 0xC6]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x56, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xE4, 0x0E, 0xBD, 0xD8, 0x30, 0xC5, 0xBD, 0x84, 0x08, 0x90, 0xBC, 0xE0, 0x72, 0xB8, 0xBC, 0xE5, 0x69, 0x1C, 0x41, 0x7B, 0xC1, 0xBC, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x04, 0x00, 0x00, 0x7A]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x9A, 0xBD, 0xBD, 0x8E, 0x63, 0x09, 0xBE, 0x8C, 0x15, 0x8A, 0xBC, 0xEF, 0x3B, 0xA8, 0xBC, 0x0B, 0x62, 0x1C, 0x41, 0x60, 0xDE, 0xB5, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x04, 0x00, 0x00, 0x89]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x6A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCA, 0x91, 0xAC, 0xBD, 0xB6, 0x09, 0xF4, 0xBD, 0x50, 0xA9, 0x8B, 0xBC, 0x8F, 0x89, 0xAF, 0xBC, 0x62, 0x67, 0x1C, 0x41, 0x18, 0x99, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x04, 0x00, 0x00, 0xD9]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x74, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0x81, 0x95, 0xBD, 0xCC, 0xDA, 0xB0, 0xBD, 0x04, 0x4A, 0xCD, 0x3B, 0x78, 0x42, 0xA3, 0xBC, 0x2D, 0x62, 0x1C, 0x41, 0xC4, 0x2F, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x04, 0x00, 0x00, 0xF0]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x7E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x0A, 0xB2, 0x3D, 0x24, 0xEF, 0x54, 0xBC, 0x84, 0x3F, 0x8B, 0x3D, 0x32, 0x52, 0x99, 0xBC, 0x14, 0x64, 0x1C, 0x41, 0x51, 0x5F, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x99]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x88, 0x04, 0x00, 0x00, 0x12, 0x04, 0x00, 0x00, 0x69, 0x91, 0xFB, 0x3D, 0x2A, 0xF7, 0xE5, 0x3C, 0xB4, 0x16, 0xBA, 0x3D, 0x7E, 0x0D, 0xB5, 0xBC, 0x13, 0x65, 0x1C, 0x41, 0x27, 0x9A, 0xAF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x04, 0x00, 0x00, 0x1A]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x92, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0x16, 0xC4, 0x3D, 0xF0, 0xDE, 0x46, 0x3B, 0x66, 0x8D, 0x82, 0x3D, 0x63, 0x25, 0x9A, 0xBC, 0x18, 0x64, 0x1C, 0x41, 0xF7, 0xCA, 0xB9, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x04, 0x00, 0x00, 0xC4]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0x9C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x85, 0xDD, 0x3D, 0x16, 0xE6, 0x01, 0xBD, 0x78, 0x4C, 0x34, 0xBC, 0x02, 0x08, 0xA6, 0xBC, 0xEB, 0x5A, 0x1C, 0x41, 0x2D, 0x15, 0xB3, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x04, 0x00, 0x00, 0xC9]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xA6, 0x04, 0x00, 0x00, 0xA6, 0x04, 0x00, 0x00, 0xBA, 0xB2, 0x19, 0x3D, 0xA4, 0xEE, 0x58, 0xBD, 0x25, 0xD5, 0xAE, 0xBD, 0xA5, 0x2F, 0xAB, 0xBC, 0xFE, 0x58, 0x1C, 0x41, 0x8A, 0x5C, 0xB7, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x04, 0x00, 0x00, 0xCD]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xB0, 0x04, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0xA4, 0x65, 0x8F, 0xBD, 0x0C, 0x76, 0x82, 0xBD, 0x8C, 0xD2, 0x39, 0xBD, 0x23, 0x39, 0xD3, 0xBC, 0xAD, 0x63, 0x1C, 0x41, 0x2B, 0xA3, 0xBA, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x04, 0x00, 0x00, 0x39]),
        new Uint8Array([0x55, 0xAA, 0x4C, 0xBA, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x0D, 0xFE, 0xBD, 0xA7, 0x14, 0x9A, 0xBD, 0xF0, 0x36, 0x55, 0xBB, 0x22, 0xFA, 0x9E, 0xBC, 0xF4, 0x61, 0x1C, 0x41, 0xFB, 0xD9, 0xB6, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA7, 0x04, 0x00, 0x00, 0x70]),
    ];

    public Definitions: UnwrapNestedRefs<Map<string, ProtocolDefinition>> = reactive(ToMap<string, ProtocolDefinition>([
        new ProtocolDefinition(1, 'Header'),
        new ProtocolDefinition(2, 'Length'),
        new ProtocolDefinition(3, 'TimeCnt'),
        new ProtocolDefinition(4, 'AngularRateX'),
        new ProtocolDefinition(5, 'AngularRateY'),
        new ProtocolDefinition(6, 'AngularRateZ'),
        new ProtocolDefinition(7, 'AcceleratedVelocityX'),
        new ProtocolDefinition(8, 'AcceleratedVelocityY'),
        new ProtocolDefinition(9, 'AcceleratedVelocityZ'),
        new ProtocolDefinition(10, 'NorthSpeed'),
        new ProtocolDefinition(11, 'SkySpeed'),
        new ProtocolDefinition(12, 'EastSpeed'),
        new ProtocolDefinition(13, 'Height'),
        new ProtocolDefinition(14, 'Longitude'),
        new ProtocolDefinition(15, 'Latitude'),
        new ProtocolDefinition(16, 'Roll'),
        new ProtocolDefinition(17, 'Yaw'),
        new ProtocolDefinition(18, 'Pitch'),
        new ProtocolDefinition(19, 'UTC'),
        new ProtocolDefinition(20, 'HeaveDisplacement'),
        new ProtocolDefinition(21, 'SumCheck'),
        new ProtocolDefinition(22, 'WorkMode'),
        new ProtocolDefinition(23, 'SelfTest'),
        new ProtocolDefinition(24, 'PosType'),
        new ProtocolDefinition(25, 'PositionOK'),
        new ProtocolDefinition(26, 'HeadingOK'),
        new ProtocolDefinition(27, 'NoSV'),
        new ProtocolDefinition(28, 'Temperature'),
        new ProtocolDefinition(29, 'HDOP'),
        new ProtocolDefinition(30, 'VnNorth'),
        new ProtocolDefinition(31, 'VnSky'),
        new ProtocolDefinition(32, 'VnEast'),
        new ProtocolDefinition(33, 'GPSLatitude'),
        new ProtocolDefinition(34, 'GPSLongitude'),
        new ProtocolDefinition(35, 'GPSHeight'),
        new ProtocolDefinition(36, 'GyrDriftX'),
        new ProtocolDefinition(37, 'GyrDriftY'),
        new ProtocolDefinition(38, 'GyrDriftZ'),
        new ProtocolDefinition(39, 'PreHeight'),
        new ProtocolDefinition(40, 'MagHeading'),
        new ProtocolDefinition(41, 'GPSHeading'),
        new ProtocolDefinition(42, 'PPSTime'),
        new ProtocolDefinition(43, 'iTow'),
    ], element => element.Name));

    public ShowParserReferences = ref(false);
    public ShowParserResults = ref(false);

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        WebWindowComponent.Default.SetBlackBackground();
        TooltipComponent.Default.Clear();

        this.DataSource.value = InertialNavigationComponent.Default.Status.value == '设备连接成功' ? 'Device' : 'Simulate';

        lock.Dispose();
    }

    public async Destroy(): Promise<void> {
        const lock = await InertialNavigationComponent.Default.WaitAsync();

        this.DataSource.value = InertialNavigationComponent.Default.Status.value == '设备连接成功' ? 'Device' : 'Simulate';

        lock.Dispose();
    }

    private OnDataSourceChanged(): void {
        if (this.DataSource.value == 'Device') {
            this.OnDataSourceChangedToDevice();
        } else {
            this.OnDataSourceChangedToSimulation();
        }
    }

    private OnDataSourceChangedToDevice(): void {
        this.Datas.clear();
    }

    private OnDataSourceChangedToSimulation(): void {
        this.Datas.clear();
        this.Datas.addRange(this.SimulatedData);
    }

    private ParseFrame(data: Uint8Array): ProtocolFrame {
        const frame = new ProtocolFrame();

        const dataView = new DataView(data.buffer, data.byteOffset, data.length);

        frame.TimeCnt = dataView.getUint32(3, true);
        frame.AngularRateX = dataView.getFloat32(11, true);
        frame.AngularRateY = dataView.getFloat32(15, true);
        frame.AngularRateZ = dataView.getFloat32(19, true);
        frame.AcceleratedVelocityX = dataView.getFloat32(23, true);
        frame.AcceleratedVelocityY = dataView.getFloat32(27, true);
        frame.AcceleratedVelocityZ = dataView.getFloat32(31, true);
        frame.NorthSpeed = dataView.getFloat32(35, true);
        frame.SkySpeed = dataView.getFloat32(39, true);
        frame.EastSpeed = dataView.getFloat32(43, true);
        frame.Height = dataView.getFloat32(47, true);
        frame.Longitude = dataView.getUint32(51, true) * 1e-7;
        frame.Latitude = dataView.getUint32(55, true) * 1e-7;
        frame.Roll = dataView.getFloat32(59, true);
        frame.Yaw = dataView.getFloat32(63, true);
        frame.Pitch = dataView.getFloat32(67, true);
        frame.UTC = dataView.getUint32(71, true) * 65536 + dataView.getUint16(75, true);
        frame.HeaveDisplacement = dataView.getInt16(77, true);
        frame.SumCheck = dataView.getUint8(79);

        const type = Math.trunc(frame.TimeCnt % 200 / 10);

        switch (type) {
            case 0:
                {
                    frame.WorkMode = dataView.getUint8(7);
                    frame.SelfTest = new DataView(new Uint8Array([dataView.getUint8(8), dataView.getUint8(9), dataView.getUint8(10), 0,]).buffer).getUint32(0, true);
                    break;
                }
            case 1:
                {
                    frame.PosType = dataView.getUint8(7);
                    frame.PositionOK = dataView.getUint8(8);
                    frame.HeadingOK = dataView.getUint8(9);
                    frame.NoSV = dataView.getUint8(10);
                    break;
                }
            case 2:
                {
                    frame.Temperature = Number.parseFloat(dataView.getFloat32(7, true).toFixed(2));
                    break;
                }
            case 3:
                {
                    frame.HDOP = dataView.getFloat32(7, true);
                    break;
                }
            case 4:
                {
                    frame.VnNorth = dataView.getFloat32(7, true);
                    break;
                }
            case 5:
                {
                    frame.VnSky = dataView.getFloat32(7, true);
                    break;
                }
            case 6:
                {
                    frame.VnEast = dataView.getFloat32(7, true);
                    break;
                }
            case 7:
                {
                    frame.GPSLatitude = dataView.getUint32(7, true) * 1e-7;
                    break;
                }
            case 8:
                {
                    frame.GPSLongitude = dataView.getInt32(7, true) * 1e-7;
                    break;
                }
            case 9:
                {
                    frame.GPSHeight = dataView.getFloat32(7, true);
                    break;
                }
            case 10:
                {
                    frame.GyrDriftX = dataView.getFloat32(7, true);
                    break;
                }
            case 11:
                {
                    frame.GyrDriftY = dataView.getFloat32(7, true);
                    break;
                }
            case 12:
                {
                    frame.GyrDriftZ = dataView.getFloat32(7, true);
                    break;
                }
            case 13:
                {
                    frame.PreHeight = dataView.getFloat32(7, true);
                    break;
                }
            case 14:
                {
                    frame.MagHeading = dataView.getFloat32(7, true);
                    break;
                }
            case 15:
                {
                    frame.GPSHeading = dataView.getFloat32(7, true);
                    break;
                }
            case 16:
                {
                    frame.PPSTime = dataView.getUint32(7, true);
                    break;
                }
            case 17:
                {
                    frame.iTow = dataView.getUint32(7, true);
                    break;
                }
            default:
                break;
        }

        return frame;
    }

    public Receive(data: Uint8Array): void {
        if (this.DataSource.value == 'Simulate') {
            return;
        }

        if (this.Datas.length > this.Capacity) {
            this.Datas.removeAt(0);
        }

        this.Datas.add(data);

        //#region 解析当前帧数据

        const parsedFrame = this.ParseFrame(data);

        this.Frame.TimeCnt = parsedFrame.TimeCnt;
        this.Frame.AngularRateX = parsedFrame.AngularRateX;
        this.Frame.AngularRateY = parsedFrame.AngularRateY;
        this.Frame.AngularRateZ = parsedFrame.AngularRateZ;
        this.Frame.AcceleratedVelocityX = parsedFrame.AcceleratedVelocityX;
        this.Frame.AcceleratedVelocityY = parsedFrame.AcceleratedVelocityY;
        this.Frame.AcceleratedVelocityZ = parsedFrame.AcceleratedVelocityZ;
        this.Frame.NorthSpeed = parsedFrame.NorthSpeed;
        this.Frame.SkySpeed = parsedFrame.SkySpeed;
        this.Frame.EastSpeed = parsedFrame.EastSpeed;
        this.Frame.Height = parsedFrame.Height;
        this.Frame.Longitude = parsedFrame.Longitude;
        this.Frame.Latitude = parsedFrame.Latitude;
        this.Frame.Roll = parsedFrame.Roll;
        this.Frame.Yaw = parsedFrame.Yaw;
        this.Frame.Pitch = parsedFrame.Pitch;
        this.Frame.UTC = parsedFrame.UTC;
        this.Frame.HeaveDisplacement = parsedFrame.HeaveDisplacement;
        this.Frame.SumCheck = parsedFrame.SumCheck;

        const type = Math.trunc(this.Frame.TimeCnt % 200 / 10);

        switch (type) {
            case 0:
                {
                    this.Frame.WorkMode = parsedFrame.WorkMode;
                    this.Frame.SelfTest = parsedFrame.SelfTest;
                    break;
                }
            case 1:
                {
                    this.Frame.PosType = parsedFrame.PosType;
                    this.Frame.PositionOK = parsedFrame.PositionOK;
                    this.Frame.HeadingOK = parsedFrame.HeadingOK;
                    this.Frame.NoSV = parsedFrame.NoSV;
                    break;
                }
            case 2:
                {
                    this.Frame.Temperature = parsedFrame.Temperature;
                    break;
                }
            case 3:
                {
                    this.Frame.HDOP = parsedFrame.HDOP;
                    break;
                }
            case 4:
                {
                    this.Frame.VnNorth = parsedFrame.VnNorth;
                    break;
                }
            case 5:
                {
                    this.Frame.VnSky = parsedFrame.VnSky;
                    break;
                }
            case 6:
                {
                    this.Frame.VnEast = parsedFrame.VnEast;
                    break;
                }
            case 7:
                {
                    this.Frame.GPSLatitude = parsedFrame.GPSLatitude;
                    break;
                }
            case 8:
                {
                    this.Frame.GPSLongitude = parsedFrame.GPSLongitude;
                    break;
                }
            case 9:
                {
                    this.Frame.GPSHeight = parsedFrame.GPSHeight;
                    break;
                }
            case 10:
                {
                    this.Frame.GyrDriftX = parsedFrame.GyrDriftX;
                    break;
                }
            case 11:
                {
                    this.Frame.GyrDriftY = parsedFrame.GyrDriftY;
                    break;
                }
            case 12:
                {
                    this.Frame.GyrDriftZ = parsedFrame.GyrDriftZ;
                    break;
                }
            case 13:
                {
                    this.Frame.PreHeight = parsedFrame.PreHeight;
                    break;
                }
            case 14:
                {
                    this.Frame.MagHeading = parsedFrame.MagHeading;
                    break;
                }
            case 15:
                {
                    this.Frame.GPSHeading = parsedFrame.GPSHeading;
                    break;
                }
            case 16:
                {
                    this.Frame.PPSTime = parsedFrame.PPSTime;
                    break;
                }
            case 17:
                {
                    this.Frame.iTow = parsedFrame.iTow;
                    break;
                }
            default:
                break;
        }

        //#endregion

        //#region 帧数据刷新应用界面数据

        this.UpdateUseConfig('信息编号', this.FrameIndex++);
        this.UpdateUseConfig('工作模式', this.Frame.WorkMode);
        this.UpdateUseConfig('自检结果', this.Frame.SelfTest);
        this.UpdateUseConfig('X轴角速度', this.Frame.AngularRateX, 10);
        this.UpdateUseConfig('Y轴角速度', this.Frame.AngularRateY, 10);
        this.UpdateUseConfig('Z轴角速度', this.Frame.AngularRateZ, 10);
        this.UpdateUseConfig('X轴加速度', this.Frame.AcceleratedVelocityX, 8);
        this.UpdateUseConfig('Y轴加速度', this.Frame.AcceleratedVelocityY, 8);
        this.UpdateUseConfig('Z轴加速度', this.Frame.AcceleratedVelocityZ, 8);
        this.UpdateUseConfig('X陀螺漂移', this.Frame.GyrDriftX, 8);
        this.UpdateUseConfig('Y陀螺漂移', this.Frame.GyrDriftY, 8);
        this.UpdateUseConfig('Z陀螺漂移', this.Frame.GyrDriftZ, 8);
        this.UpdateUseConfig('东向速度', this.Frame.EastSpeed, 10);
        this.UpdateUseConfig('北向速度', this.Frame.NorthSpeed, 10);
        this.UpdateUseConfig('天向速度', this.Frame.SkySpeed, 10);
        this.UpdateUseConfig('经度', this.Frame.Longitude, 7);
        this.UpdateUseConfig('纬度', this.Frame.Latitude, 7);
        this.UpdateUseConfig('高度', this.Frame.Height, 5);
        this.UpdateUseConfig('横滚角', this.Frame.Roll, 8);
        this.UpdateUseConfig('航向角', this.Frame.Yaw, 8);
        this.UpdateUseConfig('俯仰角', this.Frame.Pitch, 8);

        this.UpdateUseConfig('POS_TYPE', this.Frame.PosType);
        this.UpdateUseConfig('POS_OK', this.Frame.PositionOK);
        this.UpdateUseConfig('HEADING_OK', this.Frame.HeadingOK);
        this.UpdateUseConfig('卫星数', this.Frame.NoSV);
        this.UpdateUseConfig('GPS东速', this.Frame.VnEast);
        this.UpdateUseConfig('GPS北速', this.Frame.VnNorth);
        this.UpdateUseConfig('GPS天速', this.Frame.VnSky);
        this.UpdateUseConfig('定位进度', this.Frame.HDOP);
        this.UpdateUseConfig('GPS经度', this.Frame.GPSLongitude);
        this.UpdateUseConfig('GPS纬度', this.Frame.GPSLatitude);
        this.UpdateUseConfig('GPS高度', this.Frame.GPSHeight);
        this.UpdateUseConfig('气压高度', this.Frame.PreHeight);
        this.UpdateUseConfig('GPS航向', this.Frame.GPSHeading);
        this.UpdateUseConfig('升沉', this.Frame.HeaveDisplacement);
        this.UpdateUseConfig('UTC时间', new Date(this.Frame.UTC).format('hh:mm:ss:fff'));

        //#endregion

        //#region 刷新GPS坐标信息(用于运动轨迹)

        if (this.TracePlotPoints.length < 1) {
            this.TracePlotPoints.add(new GPSPoint(this.Frame.Longitude * 1e+7, this.Frame.Latitude * 1e+7));
        } else {
            const last = this.TracePlotPoints[this.TracePlotPoints.length - 1];
            if (last.Longitude != this.Frame.Longitude * 1e+7 || last.Latitude != this.Frame.Latitude * 1e+7) {
                this.TracePlotPoints.add(new GPSPoint(this.Frame.Longitude * 1e+7, this.Frame.Latitude * 1e+7));
            }
        }

        //#endregion
    }

    private UpdateUseConfig(name: string, value: string | number, fractionDigits: number | undefined = undefined): void {
        const config = this.UseConfigs.find(config => config.Name == name);
        if (config == null) {
            return;
        }

        if (typeof value == 'number') {
            config.Value = `${Number.parseFloat(value.toFixed(fractionDigits))}`;
        } else {
            config.Value = value;
        }
    }

    public Resolve(data: Uint8Array): void {
        this.ShowParserReferences.value = false;
        this.ShowParserResults.value = false;

        this.Data.value.clear();
        this.Data.value.addRange(Array.from(data));

        for (const [key, value] of Object.entries(this.ParseFrame(data))) {
            this.Definitions.get(key)!.Reference = value.toString();
        }
    }

    public Convert(input: string, fromRadix: number, toRadix: number): string {
        return input == '' ? '' : Number.parseInt(input, fromRadix).toString(toRadix);
    }
}

/**
 * 应用界面
 */
export class UsageComponent {
    private static instance: UsageComponent = new UsageComponent();
    /**
     * 应用界面
     */
    public static get Default(): UsageComponent {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        this.watchStopHandles.clear();
    }

    public ShowTracePlot: Ref<boolean> = ref(false);
    public ShowGPSLocation: Ref<boolean> = ref(false);

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
    }

    public async Destroy(): Promise<void> {
    }
}